xmlhttprequest not support file protocol
H-TWINKLE opened this issue · comments
if the link protocol is file,such as “file:///E:/a.css”
will be blocked,
error meesage is " origin 'null' has been blocked by cors policy: cross origin requests are only support protocol schemes: http ,data,chrome,chrome-extension,chrome-untrustef,https"
html link is
Thanks.
This is a security restriction enforced by browsers (like Chrome) to prevent web content from accessing your local file system. The are only two ways the ponyfill can access stylesheets via the file://
protocol:
- Modify the security settings in your browser to allow local file access. Before you do so, understand the security risks you are introducing.
- Use a browser that allows local file access. Firefox used to allow this, but I'm not sure if it still does.
- Host your stylesheet on a server so it can be accessed via http/https. For example, you could host the stylesheet in a GitHub repo at no charge.
Hope this helps. :)