Commit d5688180 authored by chriseth's avatar chriseth

Use absolute url for worker.

parent eb83596b
...@@ -201,6 +201,13 @@ function Compiler (editor, handleGithubCall) { ...@@ -201,6 +201,13 @@ function Compiler (editor, handleGithubCall) {
jobs.push({sources: source}); jobs.push({sources: source});
worker.postMessage({cmd: 'compile', job: jobs.length - 1, source: JSON.stringify(source), optimize: optimize}); worker.postMessage({cmd: 'compile', job: jobs.length - 1, source: JSON.stringify(source), optimize: optimize});
}; };
if (!url.startsWith('http') && !url.startsWith('file')) {
var loc = window.document.location;
var locStr = loc.protocol + '//' + loc.host + '/' + loc.pathname;
if (!locStr.endsWith('/'))
locStr += '/';
url = locStr + url;
}
worker.postMessage({cmd: 'loadVersion', data: url}); worker.postMessage({cmd: 'loadVersion', data: url});
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment