“No 'Access-Control-Allow-Origin' header is present on the requested resource.”

China☆狼群 提交于 2019-12-18 18:54:02

问题


I already tried looking for various questions, but that didn't help/I am too inexperienced to understand, so I have to be specific. This is what I get in the console:

XMLHttpRequest cannot load https://a.websight.com/file/hex.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'chrome-extension://asdfghetcetcetc' is therefore not allowed access. (index):1

It's breaking my entire extension and I don't know how to fix it. I would appreciate any help.


回答1:


Although question is quite old, I found that google developer site provide easy way to remember global kind of permission. If you want to make cross origin ajax requests in any where you can add "permissions": ["<all_urls>"] to the manifest. Or else you can use matching patterns which are described in here.



来源:https://stackoverflow.com/questions/20155283/no-access-control-allow-origin-header-is-present-on-the-requested-resource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!