Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome 为什么更改它使我的内容脚本为http站点而不是所有URL运行会使内容脚本显示在开发人员工具中?_Google Chrome_Google Chrome Extension_Google Chrome Devtools_Content Script - Fatal编程技术网

Google chrome 为什么更改它使我的内容脚本为http站点而不是所有URL运行会使内容脚本显示在开发人员工具中?

Google chrome 为什么更改它使我的内容脚本为http站点而不是所有URL运行会使内容脚本显示在开发人员工具中?,google-chrome,google-chrome-extension,google-chrome-devtools,content-script,Google Chrome,Google Chrome Extension,Google Chrome Devtools,Content Script,我正在学习Chrome扩展,并制作一些hello world应用程序。我正在编写内容脚本 首先,我的应用程序非常简单,它只是一个加载内容脚本的清单 这是舱单 { "name": "turn all th into TH", "version": "1.0", "permissions": [ "http://*/*" ], "manifest_version": 2, "content_scripts": [ { "matches": ["&l

我正在学习Chrome扩展,并制作一些hello world应用程序。我正在编写内容脚本

首先,我的应用程序非常简单,它只是一个加载内容脚本的清单

这是舱单

{
  "name": "turn all th into TH",
  "version": "1.0",
  "permissions": [
    "http://*/*"
  ],
  "manifest_version": 2,

 "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["contentScriptFirstApp.js"]
    }
  ]
}

只是好奇为什么会这样。在这两种情况下,代码都在运行并显示警报框,但为什么只有当内容脚本页面的“matches”参数设置为http页面时,它才开始显示在开发人员工具中?

非常确定这只是巧合,也是我在首次加载扩展时经常看到的故障

当我使用你的
“时,我已经看到了这个问题,但我还没有找到一种可靠的方法来按需复制这个问题


不管是什么原因,关闭该选项卡并打开一个新选项卡总是可以解决问题(到目前为止)。因此,当您更改清单时,可能有足够多的中间环节,扩展碰巧出现在开发工具中。正如我所说,清单工作,扩展为我显示,无论
设置是否匹配。

您是对的,即使http也不再工作。看起来它不是ch但是chrome开发者工具有问题。关闭第一个选项卡并打开一个新的选项卡似乎也不能解决问题:(哦,天哪。可能是时候重新启动chrome和它正在运行的任何任务了。可能是(无声的)代码中的错误?我关闭了我正在做的另一个测试扩展,它现在似乎正在工作。尽管我再次确信这只是巧合-扩展只是另一个简单的扩展。我想,意识到这个问题很好。祝你好运。如果你找到一个可靠的方法来触发这个小故障,请让我们知道。这这将是让谷歌修复它的第一步。
{
  "name": "turn all th into TH",
  "version": "1.0",
  "permissions": [
    "http://*/*"
  ],
  "manifest_version": 2,

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