Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read local xml file with xmlhttp request #12

Open
EthanS94 opened this issue Aug 28, 2019 · 2 comments
Open

Can't read local xml file with xmlhttp request #12

EthanS94 opened this issue Aug 28, 2019 · 2 comments

Comments

@EthanS94
Copy link
Collaborator

It seems loading this locally with file:///path/to/index.html broke sometime recently. Javascript(with XMLHttpRequest is not allowed to query ColorMaps.xml if it is a local file. It still works fine when sending requests to an http server.

The error I get is:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///path/to/ColorMaps.xml. (Reason: CORS request not http).
@terryturton
Copy link

Ethan, I also have this as an issue in cinemascience/cinema_explorer#16.
Hack fix: I can get around this by going to about:config in my browser and changing privacy.file_unique_origin to false in Firefox.

Or yes, do the http server -- from Jon Woodring

I’m instead running a simple http server instead out of the cinema explorer directory.
Python 2:
$ python -m SimpleHTTPServer
Python 3:
$ python -m http.server

@EthanS94
Copy link
Collaborator Author

Thanks, Terry. That works for me. Once I add this to some documentation on the website, I'll close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants