forward document.URL to worker
This commit is contained in:
Родитель
568d32ec75
Коммит
cd0d4a00f6
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче