mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix browsers that do not support Promises
This commit is contained in:
parent
89a5c2d590
commit
c46c6c2203
6 changed files with 21 additions and 30 deletions
|
@ -19,11 +19,23 @@
|
|||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
injectScriptElement(
|
||||
self.Promise ? "./libraries/alameda.js" : "./libraries/require.js",
|
||||
function() {
|
||||
// onload of require library
|
||||
injectScriptElement("./scripts/site.js");
|
||||
}
|
||||
);
|
||||
function loadSite() {
|
||||
injectScriptElement(
|
||||
"./libraries/alameda.js",
|
||||
function() {
|
||||
// onload of require library
|
||||
injectScriptElement("./scripts/site.js");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!self.Promise) {
|
||||
// Load Promise polyfill if they are not natively supported
|
||||
injectScriptElement(
|
||||
"./libraries/npo.js",
|
||||
loadSite
|
||||
);
|
||||
} else {
|
||||
loadSite();
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue