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

loading a local file (file:///) using polymer will fail to load properly #260

Closed
dinhvh opened this issue Aug 27, 2013 · 4 comments
Closed

Comments

@dinhvh
Copy link

dinhvh commented Aug 27, 2013

To reproduce:
Once you checked out polymer-all, try to load an example from the disk.

By loading file://localhost/.../polymer-all/polymer-ui-elements/polymer-ui-toolbar/index.html in Chrome, I get the following console error:

XMLHttpRequest cannot load file://localhost/Users/dvh/Polymer/polymer-all/polymer-ui-elements/polymer-ui-toolbar/polymer-ui-toolbar.html. Cross origin requests are only supported for HTTP. index.html:1
Uncaught NetworkError: A network error occurred. 

Workaround:
You have to set up a web server to try your code.

@dfreedm
Copy link
Member

dfreedm commented Aug 27, 2013

This is a Chrome default security setting: https://code.google.com/p/chromium/issues/detail?id=37586. You can override with the --allow-file-access-from-files flag.

@dfreedm dfreedm closed this as completed Aug 27, 2013
@dinhvh
Copy link
Author

dinhvh commented Aug 27, 2013

From a user of UI widgets perspective, when I used bootstrap, I didn't have that kind of issues.
It would be great if Polymer would match the same kind of "usability".

@dfreedm
Copy link
Member

dfreedm commented Aug 27, 2013

There's nothing we can do about this case until HTMLImports are native. Even then, I'm not sure that they would allow file:// access.

@dinhvh
Copy link
Author

dinhvh commented Aug 27, 2013

If native HTMLImports solves this issue, that's probably fine.

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