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 /js/src | |
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
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/Ice/browser/TimerUtil.js | 35 |
1 files changed, 14 insertions, 21 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; } |