简体   繁体   English

在Google Chrome扩展程序manifest.json中启用跨域权限

[英]Enable cross domain permission in google chrome extension manifest.json

I'm creating a simple extension for Chrome. 我正在为Chrome创建一个简单的扩展程序。 This extension will display a mobile view of the current opened tab of Chrome. 此扩展程序将显示Chrome当前打开的标签页的移动视图。

Here is my manifest.json: 这是我的manifest.json:

{
  "manifest_version": 2,

  "name": "Responsive View",
  "description": "This extension will Display Mobile View Of current opened Tab of Chrome",
  "version": "1.0",

  "browser_action": {
   "default_icon": "icon.png",
   "default_popup": "popup.html"
  },
  "permissions": ["activeTab"] 
    // what code should be here to grant all permissions for cross domain response?
}

what code should be here for grant all permission of cross domain response 授予跨域响应所有权限的代码应在此处

Corresponding documentation is here: Match Patterns . 相应的文档在这里: 匹配模式

The easiest match pattern to capture all hosts is, literally, "<all_urls>" . 从字面上看,最简单的匹配模式是"<all_urls>"

If you want to limit this to http/https scheme, you can use "*://*/*" 如果要将其限制为http / https方案,则可以使用"*://*/*"

Note that using either of those will create an install-time permission warning : 请注意,使用其中任何一个都会创建安装时权限警告

Add "Responsive View"? 添加“响应视图”?

It can: 它可以:

  • Read and modify all your data on all websites you visit 阅读和修改您访问的所有网站上的所有数据

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

相关问题 在Chrome扩展manifest.json中检测锚点 - Detect anchor in Chrome Extension manifest.json 如何从Chrome扩展程序的选项页面启用/禁用manifest.json CSS内容脚本? - How to enable/disable manifest.json CSS content script from Chrome Extension's options page? Chrome 扩展程序,如何在 manifest.json 中排除 chrome:// URI - Chrome extension, how to exclude chrome:// URIs in manifest.json 如何在我的manifest.json文件中包括jQuery扩展的jQuery - How to include jQuery in my manifest.json file for a chrome Extension Chrome扩展程序:Manifest.json在选项中包含JS - Chrome Extension: Manifest.json include JS in options 制作 manifest.json 文件时 Chrome 扩展程序错误 - Chrome extension error while making manifest.json file Chrome扩展程序-manifest.json加载文件夹中的所有js - Chrome Extension - manifest.json load all js in folder 在 Chrome 扩展清单 v3 中,我如何指示 manifest.json 仅在某些网页上运行我的扩展而不使用 activeTab 权限? - In Chrome extension Manifest v3, how do i instruct manifest.json to run my extension only on certain webpages without using activeTab permission? Google Chrome扩展程序跨域XMLHttpRequest - Google Chrome extension Cross Domain XMLHttpRequest Manifest.json中的Chrome扩展程序的自定义值? - Custom Values in Manifest.json for Chrome Extensions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM