Yes, if your webpage is opened via the file://
protocol, any request is cross-origin.
If you really need to load JSON files over the file://
protocol, you have three options:
- Disable the browser setting for CORS protection. For example for Firefox this is: security.fileuri.strict_origin_policy in about:config, which I obviously don’t recommend, or
- Load your JSON files via JSONP, or
- Start a local web server with Python or Node.js to server your files over
http://localhost
thus not doing cross-origin requests.