diff --git a/src/proxyClient.js b/src/proxyClient.js index 3fc8313fe..8ab99d887 100644 --- a/src/proxyClient.js +++ b/src/proxyClient.js @@ -82,7 +82,7 @@ var worker = new Worker('{{{ filename }}}.js'); WebGLClient.prefetch(); setTimeout(function() { - worker.postMessage({ target: 'worker-init', width: Module.canvas.width, height: Module.canvas.height, preMain: true }); + worker.postMessage({ target: 'worker-init', width: Module.canvas.width, height: Module.canvas.height, URL: document.URL, preMain: true }); }, 0); // delay til next frame, to make sure html is ready var workerResponded = false; diff --git a/src/proxyWorker.js b/src/proxyWorker.js index 7647b5dad..1753dd334 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -271,6 +271,8 @@ document.styleSheets = [{ } }]; +document.URL = 'http://worker.not.yet.ready.wait.for.window.onload?fake'; + function Audio() { Runtime.warnOnce('faking Audio elements, no actual sound will play'); } @@ -393,6 +395,8 @@ onmessage = function onmessage(message) { Module.canvas = document.createElement('canvas'); Module.canvas.width_ = message.data.width; Module.canvas.height_ = message.data.height; + document.URL = message.data.URL; + window.fireEvent({ type: 'load' }); removeRunDependency('worker-init'); break; }