Skip to content

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

Description

@dinhvh

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.

Activity

  1. dfreedm commented on Aug 27, 2013

    @dfreedm
    Member

    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.

  2. dinhvh commented on Aug 27, 2013

    @dinhvh
    Author

    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".

  3. dfreedm commented on Aug 27, 2013

    @dfreedm
    Member

    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.

  4. dinhvh commented on Aug 27, 2013

    @dinhvh
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions