简体   繁体   English

Google Chrome扩展程序HTTPS Ajax请求

[英]Google Chrome Extension HTTPS Ajax Request

I'm creating a google chrome extension , and i need to send an ajax request to a https * rest api *. 我正在创建Google Chrome扩展程序 ,我需要向https * rest api *发送ajax请求。 I was testing this request on http page and i was making the request to a https page, so it didn't worked because the cross domain posting. 我在http页面上测试了这个请求,我正在向https页面发出请求,所以它没有用,因为跨域发布。 So i was searching if the chrome extensions have this "problem" too. 所以我在搜索chrome扩展是否也有这个“问题”。 Anyone knows if its possible to send a request to a https page from a chrome extension? 任何人都知道是否可以从Chrome扩展程序向https页面发送请求?

Thanks in advance :) 提前致谢 :)

Add this to your manifest to allow your extension to access any https site. 将此添加到您的清单,以允许您的扩展程序访问任何https网站。

{
  "name": "My extension",
  ...
  "permissions": [
    "https://*/*"
  ],
  ...
}

See http://developer.chrome.com/extensions/xhr.html for more info 有关详细信息,请参阅http://developer.chrome.com/extensions/xhr.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM