diff options
author | Jose <jose@zeroc.com> | 2018-03-29 15:11:43 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-03-29 15:11:43 +0200 |
commit | b96cc78d56bbca4ad8d0b655518d68831c546aa9 (patch) | |
tree | ef1df928a6a3fc3f21bd6c17df0883d4f44159d3 | |
parent | Do not unload DLLs with UWP test controller (diff) | |
download | ice-b96cc78d56bbca4ad8d0b655518d68831c546aa9.tar.bz2 ice-b96cc78d56bbca4ad8d0b655518d68831c546aa9.tar.xz ice-b96cc78d56bbca4ad8d0b655518d68831c546aa9.zip |
Do not use WebWorkers with IE11
WebWorkers with IE11 can get stall, updated the timer to not
use a WebWorker with IE11 and test scripts to not run tests
with worker option
-rw-r--r-- | js/src/Ice/browser/TimerUtil.js | 35 | ||||
-rw-r--r-- | scripts/Util.py | 2 |
2 files changed, 15 insertions, 22 deletions
diff --git a/js/src/Ice/browser/TimerUtil.js b/js/src/Ice/browser/TimerUtil.js index 90317ec92d5..54388e04c66 100644 --- a/js/src/Ice/browser/TimerUtil.js +++ b/js/src/Ice/browser/TimerUtil.js @@ -186,7 +186,16 @@ const workerCode = function() }.toString() + "());"; }; -if(typeof(WorkerGlobalScope) !== 'undefined' && this instanceof WorkerGlobalScope) +if(typeof navigator !== "undefined" && + (navigator.userAgent.indexOf("MSIE") !== -1 || + navigator.userAgent.match(/Trident.*rv:11\./))) +{ + // + // With IE always use the setInterval/setTimeout browser functions directly + // + Ice.Timer = createTimerObject(); +} +else if(typeof WorkerGlobalScope !== 'undefined' && this instanceof WorkerGlobalScope) { // // If we are running in a worker don't spawn a separate worker for the timer @@ -195,24 +204,8 @@ if(typeof(WorkerGlobalScope) !== 'undefined' && this instanceof WorkerGlobalScop } else if(worker === undefined) { - let url; - try - { - url = URL.createObjectURL(new Blob([workerCode()], {type : 'text/javascript'})); - worker = new Worker(url); - worker.onmessage = Timer.onmessage; - Ice.Timer = Timer; - } - catch(ex) - { - if(url !== undefined) - { - URL.revokeObjectURL(url); - } - // - // Fallback on setInterval/setTimeout if the worker creating failed. Some IE10 and IE11 don't - // support creating workers from blob URLs for instance. - // - Ice.Timer = createTimerObject(); - } + const url = URL.createObjectURL(new Blob([workerCode()], {type : 'text/javascript'})); + worker = new Worker(url); + worker.onmessage = Timer.onmessage; + Ice.Timer = Timer; } diff --git a/scripts/Util.py b/scripts/Util.py index ac4606dc240..a354ab417ce 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -3632,7 +3632,7 @@ class JavaScriptMapping(Mapping): "serialize" : [False], "mx" : [False], "es5" : [True] if current.config.es5 else [False, True], - "worker" : [False, True] if current.config.browser else [False], + "worker" : [False, True] if current.config.browser and current.config.browser != "Ie" else [False], } return options |