-
Notifications
You must be signed in to change notification settings - Fork 180
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
Does it work with the file:// protocol? #20
Comments
Modern browsers treat file: URLs pretty restrictively and consider them to be different origins in most cases- see for example this note from MDN https://developer.mozilla.org/en-US/docs/Same-origin_policy_for_file%3A_URIs However, you can use a light-weight development server such as node http-server or python SimpleHTTPServer and then access it over http://localhost which will be the same origin. |
So it won't work with file:// protocol? On 11/14/2015 05:03 AM, Jason Denizac wrote:
|
I don't have a good test case in front of me, but I expect that it would not work. Could you describe your use case and what you're trying to achieve? |
I have a multipage app(survey), which needs to store data until an On 11/14/2015 05:07 AM, Jason Denizac wrote:
|
http://localhost/client.html using file://path/to/hub.html will fail because browsers don't allow it. file://client.html using http://localhost/hub.html will fail because message.origin is the string "null" |
woops, should read:
|
The two scenarios I highlighted above will work with this quick fix. The issue was twofold:
For consistency, you can specify an origin of |
I understand this will work well with cross origin urls, but can it work with the file:// protocol or is a web server necessary?
The text was updated successfully, but these errors were encountered: