permissions - 内容脚本可以在 https 页面上运行 chrome 扩展开发

标签 permissions https google-chrome-extension

我正在开发一个 chrome 扩展,当我在 http 页面上运行内容脚本时,没问题。但我很困惑为什么它不能在 https 页面上执行。内容脚本可以在 https 页面上运行。我的权限 ID 就是这样。 “权限”:[ "http://*/*", "https://*/*", “标签” ],

最佳答案

除了将 https 包含在 list 的 permissions 部分之外,您还需要将其包含在 matches 部分 content_scripts 部分:

"content_scripts": [
  {
    "matches": ["http://*/*", "https://*/*"],
    "js": ["script.js"]
  }
]

关于permissions - 内容脚本可以在 https 页面上运行 chrome 扩展开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8365284/

相关文章:

用户输入的 Python 安全限制

macos - Xcode 扩展 + Mac 助手应用程序 + 启动参数?

html - 如何在 IE9 中使用协议(protocol)相关 URL?

java - java访问https站点的方法

javascript - 如何解决从网页向 Chrome 扩展程序发送数据的问题?

java - 为 JSP/Tomcat/Windows 设置目录权限

node.js - NodeJS https服务器没有响应

Javascript 同步函数 - chrome 扩展

google-chrome - Google Chrome 中的自定义拼写

ruby-on-rails - 禁止访问 您无权访问 Bitnami Ruby Rails