If I try to use web workers through a JavaScript file, Chrome throws an error -
Uncaught SecurityError: Failed to create a worker: script at '(path)/worker.js' cannot be accessed from origin 'null'.
But it allows them if we use directly through the HTML.
The answer on Chrome can't load web worker says Chrome doesn't let you load web workers when running scripts from a local file.
Why doesn't chrome allow web workers to run locally?
Web Workers work completely fine in Firefox, Safari and in Edge