且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

访问控制 - 允许 - 铬扩展的原点

更新时间:2023-01-08 23:41:55

https://developer.chrome.com/extensions/xhr



仔细阅读该文档,并检查您的权限设置是否正确。


I'm making a Chrome extension which pulls data from my own server. It uses about 4 httpRequests at a time, but sometimes I get console error as follows:

XMLHttpRequest cannot load http://apps.radionsm.lv/apps/system/index.php?request=now. Origin chrome-extension://egkddfmbidfobhchndockbhjancbpfkd is not allowed by Access-Control-Allow-Origin. for everyone sometimes no.

If I send header('Access-Control-Allow-Origin: *'); will this fix it?

https://developer.chrome.com/extensions/xhr

Read through that documentation and check that your permissions have been setup correctly.