访问控制 - 允许 - 铬扩展的原点 [英] Access-Control-Allow-Origin on chrome extension

查看:129
本文介绍了访问控制 - 允许 - 铬扩展的原点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个Chrome扩展程序,用于从我自己的服务器中提取数据。它一次使用大约4个httpRequests,但有时我得到控制台错误,如下所示:

XMLHttpRequest无法加载http://apps.radionsm。 LV /应用/系统/的index.php?请求=现在。 Origin chrome-extension:// egkddfmbidfobhchndockbhjancbpfkd不允许被Access-Control-Allow-Origin。给大家有时没有。



如果我发送 header('Access-Control-Allow-Origin:*'); 会解决吗?

解决方案

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.

这篇关于访问控制 - 允许 - 铬扩展的原点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆