Google chrome 如何在扩展中运行的html页面中插入内容脚本

Google chrome 如何在扩展中运行的html页面中插入内容脚本,google-chrome,google-chrome-extension,Google Chrome,Google Chrome Extension,我创建了一个Chrome扩展,它包含两个html页面background.html和helper.html 我试图将代码注入helper.html,当然,它在扩展内部运行helper.html作为我用chrome创建的弹出窗口运行。windows.create(objectcreatedata,函数回调)。然而,到目前为止,我无法做到这一点。从文档中我了解到我的内容脚本规则应该是 "content_scripts": [ { "matches": ["c

我创建了一个Chrome扩展,它包含两个html页面
background.html
helper.html

我试图将代码注入
helper.html
,当然,它在扩展内部运行
helper.html
作为我用chrome创建的
弹出窗口运行。
windows.create(objectcreatedata,函数回调)
。然而,到目前为止,我无法做到这一点。从文档中我了解到我的内容脚本规则应该是

   "content_scripts": [
        {
          "matches": ["chrome-extension://*/*"],
          "js": ["jquery.js","myscript.js"],
           "css": ["style.css"],
          "run_at": "document_end"
        }
但它失败了

请注意,例如,当我使用localhost时

"content_scripts": [
    {
      "matches": ["http://localhost/"],
      "js": ["jquery.js","myscript.js"],
      "css": ["style.css"],
      "run_at": "document_end"
    }

它起作用了。本地主机运行完全相同的代码,但不知何故扩展名拒绝识别我试图匹配的文件(
“matches”:[“chrome扩展名://*/*”]

chrome扩展名无法将内容脚本注入chrome扩展名

你会想用它来代替