Why does not Chrome allow Web Workers to be run in JavaScript?
<p>If I try to use web workers through a JavaScript file, Chrome throws an error - </p>

<blockquote>
  <p>Uncaught SecurityError: Failed to create a worker: script at '(path)/worker.js' cannot be accessed from origin 'null'.</p>
</blockquote>

<p>But it allows them if we use directly through the HTML.</p>

<p>The answer on <a href="https://stackoverflow.com/questions/21408510/chrome-cant-load-web-worker">Chrome can&#39;t load web worker</a> says Chrome doesn't let you load web workers when running scripts from a local file. </p>

<p>Why doesn't chrome allow web workers to run locally?</p>

<p>Web Workers work completely fine in Firefox, Safari and in Edge</p>