Closed yash-me closed 4 years ago
Thankyou, But i have tried it doesn't work on file://URI and it wasted my one day. You need to clarify in Read.me
On Fri, Oct 2, 2020 at 4:25 AM christopher luna notifications@github.com wrote:
I'm assuming you mean that it doesn't work on file:// URIs.
It's unnecessary to clarify it because is not something that applies only to this web component, but to every web component out there.
To use CORS access is necessary, and that is not available with file:// URIs.
If you try it, on chrome you would get Access to imported resource at 'file:///path/to/some-web-component.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https. (notice that file is not included)
Is not necessary to add that on the README.md, because it's purpose is only to give specifics on this particular web component, not to teach something that applies to web components in general.
(Now, if you really want to use this component over a file:// URI, maybe it's possible to do it if you embed the content of the component files inside the html where you are going to use the component. I haven't tried it, so I'm not sure if that actually works, you would have to check it on your own.
But easier and better just to use a simple http server. On pretty much every system that has python installed, you can start a simple http server with this command: python -m SimpleHTTPServer)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chris-l/bin-packing-grid/pull/9#issuecomment-702438487, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANMABIAUCXEV5RDQGATSO23SIUCGPANCNFSM4SAXO2GA .
I'm assuming you mean that it doesn't work on
file://
URIs.It's unnecessary to clarify it because is not something that applies only to this web component, but to every web component out there.
To use
<link rel="import" href="some-web-component.html">
CORS access is necessary, and that is not available withfile://
URIs.If you try it, on chrome you would get
Access to imported resource at 'file:///path/to/some-web-component.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
(notice that file is not included)Is not necessary to add that on the README.md, because it's purpose is only to give specifics on this particular web component, not to teach something that applies to web components in general.
(Now, if you really want to use this component over a
file://
URI, maybe it's possible to do it if you embed the content of the component files inside the html where you are going to use the component. I haven't tried it, so I'm not sure if that actually works, you would have to check it on your own.But easier and better just to use a simple http server. On pretty much every system that has python 2 installed, you can start a simple http server with this command:
python -m SimpleHTTPServer
)