Use absolute url for worker.

pull/1/head
chriseth 8 years ago
parent eb83596bf2
commit d5688180a7
  1. 7
      src/app/compiler.js

@ -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});
} }

Loading…
Cancel
Save