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

Imported resource from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Received an invalid response. Origin 'null' is therefore not allowed access. #1535

Closed
ghost opened this issue May 14, 2015 · 12 comments

Comments

@ghost
Copy link

ghost commented May 14, 2015

I did the same site as the Making app for 10 minutes , and Chrome
display and white image , the Inspect element was a bug as its title .

Also, bower_components \ polymer \ docs \ index.html was a few files that did not exist . These are:

  • Bower_components / polymer / perf - lib / perf.js
  • Bower_components / polymer / x- elements / x -doc -viewer / x- doc- viewer.html
  • Bower_components / polymer / assets / icons.html

It is a version of the Polymer 0.5 .
Please look at this , I was two or three weeks looked for this.

@miztroh-zz
Copy link

Due to the way HTML imports work, Polymer requires a web server. You could try developing using Chrome Dev Editor, which has a built-in web server.

https://chrome.google.com/webstore/detail/chrome-dev-editor-develop/pnoffddplpippgcfjdhbmhkofpnaalpg

@sorvell
Copy link
Contributor

sorvell commented May 21, 2015

By design HTMLImports can only load resources from the same (non-file) domain or domains that support CORS.

@sorvell sorvell closed this as completed May 21, 2015
@kevinpschaaf
Copy link
Member

Those docs are old and vestigial, thanks for pointing out. We'll remove. The PRIMER.md and polymer-project.org website should be used for docs.

@codedcontainer
Copy link

You could alwasy just set up your own node server and then you can present these locally instead of pushing them to your own testing server.

@kolarski
Copy link

kolarski commented Apr 6, 2016

How about using polymer inside cordova ?

@xiaoxuanwang
Copy link

We could easily start a web server by using python:
python -m SimpleHTTPServer 8000

@josephmokenela
Copy link

You can consider using polymer starter kit as well and install the local development server.
The instructions are on the following link.
https://developers.google.com/web/tools/polymer-starter-kit/

@stevenroose
Copy link

Wait what?? With the "new web" we will no longer be able to open HTML files from local files?? What the hell?? Can someone perhaps point me to some documentation of this?

@miztroh-zz
Copy link

@stevenroose Opening an HTML file directly will work just fine via a file protocol URL. However, HTMLImports cannot load data via that protocol.

@stevenroose
Copy link

Opening an HTML file directly will work just fine

Only when that file doesn't import other files. What if I want to create an offline-capable browser dashboard that does use htmlimports?

@miztroh-zz
Copy link

Operating offline isn't the issue. The protocol is the issue. file:// requests will not work, but you can run a local web server (polymer serve, express, etc.) to use HTTP requests instead. You could even use the following Chrome extension to run a local web server.

https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?hl=en

@DieAntonie
Copy link

@stevenroose , this isn't an issue in Edge

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

9 participants