Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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 在google chrome中为不同站点设置内容脚本_Google Chrome_Google Chrome Extension - Fatal编程技术网

Google chrome 在google chrome中为不同站点设置内容脚本

Google chrome 在google chrome中为不同站点设置内容脚本,google-chrome,google-chrome-extension,Google Chrome,Google Chrome Extension,我查看了google chrome扩展实验室页面,没有看到任何可以为不同站点使用不同内容脚本的示例。他们有一个页面,显示如何在一个站点上拥有多个内容脚本,而不是相反。有没有办法让不同的网站有不同的内容脚本 { "name": "My extension", ... "content_scripts": [ { "matches": ["http://www.google.com/*"], "js": ["script1.js"] },{

我查看了google chrome扩展实验室页面,没有看到任何可以为不同站点使用不同内容脚本的示例。他们有一个页面,显示如何在一个站点上拥有多个内容脚本,而不是相反。有没有办法让不同的网站有不同的内容脚本

{
  "name": "My extension",
  ...
  "content_scripts": [
    {
      "matches": ["http://www.google.com/*"],
      "js": ["script1.js"]
    },{
      "matches": ["http://www.yahoo.com/*"],
      "js": ["script2.js"]
    }
  ],
  ...
}