I load a local html file from my windows 7 filesytem :
file:///C:/Users/...etc.../myfile.html
Inside it, an existent file relative to the directory of myfile.html :
....load("../common/events.json");
Firefox refuses it, error at console :
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote
resource at file:///C:/Users/...etc.../common/events.json?timeshift=-60. (Reason: CORS request not http).
With link : https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp
So I set privacy.file_unique_origin to false in config and restarted Firefox : same issue
NB all is ok with ... IE 11 !
You could start your own local server:
python3 -m http.server
which tells you the port (e.g. Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)).
Then something enter in browser address bar something like
http://0.0.0.0:8000/C:/Users/...etc.../myfile.html.
The path is relative to the location where the server was started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With