Started adding asset api/auto import

This commit is contained in:
Masu-Baumgartner
2024-11-26 17:33:51 +01:00
parent 23a74bdfc6
commit bc737c830f
7 changed files with 176 additions and 29 deletions

View File

@@ -25,5 +25,24 @@ window.moonlight = {
closeCurrent() {
window.close();
}
},
assets: {
loadCss: function (url) {
let linkElement = document.createElement('link');
linkElement.href = url;
linkElement.rel = 'stylesheet';
linkElement.type = 'text/css';
(document.head || document.documentElement).appendChild(linkElement);
},
loadJavascript: function (url) {
let scriptElement = document.createElement('script');
scriptElement.src = url;
scriptElement.type = 'text/javascript';
(document.head || document.documentElement).appendChild(scriptElement);
}
}
};