mirror of
https://git.proxmox.com/git/mirror_novnc
synced 2025-07-27 13:22:08 +00:00
IE compatibility fix for babel workers
IE doesn't support document.currentScript, so we need to have a fallback.
This commit is contained in:
parent
be70fe0a3d
commit
edb7879927
@ -1297,7 +1297,14 @@ function xhrFetch(url, resolve, reject) {
|
||||
}
|
||||
|
||||
var WorkerPool = function (script, size) {
|
||||
script = document.currentScript.src.substr(0, document.currentScript.src.lastIndexOf("/")) + "/" + script;
|
||||
var current = document.currentScript;
|
||||
// IE doesn't support currentScript
|
||||
if (!current) {
|
||||
// We should be the last loaded script
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
current = scripts[scripts.length - 1];
|
||||
}
|
||||
script = current.src.substr(0, current.src.lastIndexOf("/")) + "/" + script;
|
||||
this._workers = new Array(size);
|
||||
this._ind = 0;
|
||||
this._size = size;
|
||||
|
File diff suppressed because one or more lines are too long
@ -137,7 +137,14 @@ function xhrFetch(url, resolve, reject) {
|
||||
}
|
||||
|
||||
var WorkerPool = function (script, size) {
|
||||
script = document.currentScript.src.substr(0, document.currentScript.src.lastIndexOf("/")) + "/" + script;
|
||||
var current = document.currentScript;
|
||||
// IE doesn't support currentScript
|
||||
if (!current) {
|
||||
// We should be the last loaded script
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
current = scripts[scripts.length - 1];
|
||||
}
|
||||
script = current.src.substr(0, current.src.lastIndexOf("/")) + "/" + script;
|
||||
this._workers = new Array(size);
|
||||
this._ind = 0;
|
||||
this._size = size;
|
||||
|
Loading…
Reference in New Issue
Block a user