Languages

JavaScript - Google Chrome can't load web worker

0 points
Asked by:
Wiktor-Sribiew
860

Hello, I'm working with web workers in JavaScript and I have a problem with loading them in Google Chrome.

Can you help me with this?

I have the following error:

Uncaught DOMException: Failed to construct 'Worker': Script at 'file:///C://path/worker.js' cannot be accessed from origin 'null'.
1 answer
0 points
Answered by:
Wiktor-Sribiew
860

Google Chrome does not allow the use of web workers while running JavaScript code from local files.

You need to run the website on the localhost.

See also

  1. JavaScript / HTML - how can I run file on localhost?
0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join