Cross-origin request for local file

For anyone who wants to know, I had to run a server in the app to serve the js files. Seems like it's not possible to do it without running a server. If anyone knows of another way, do tell.


If you are using VS Code, the Live Server extension might help you. It resolved a cross-origin issue I was having when editing a webpage.

https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer


The simplest way to allow this in Firefox is to navigate to about:config, look for the privacy.file_unique_originsetting and toggle it off.

Essentially, Firefox used to treat local files from the same directory as being from the same source, thus CORS was happily satisfied. That behavior changed after CVE-2019-11730 was discovered.

It worked fine for me on 84.0.1 on Arch. Just be sure to turn it off when not locally debugging.

Source