0

我正在尝试为将 www.site.com 重定向到 site.com 的网站获取 Chrome 扩展程序

此清单文件有效。

{
"name" : "MySite Redesign",
"version": "0.1",
"manifest_version": 2,
"description" : "Improves MySite visual design to make the interface cleaner.",
"content_scripts" : [{
    "matches" : ["*://www.mysite.com/*"],
    "css" : ["style.css"]
  }]
}

这不

{
"name" : "MySite Redesign",
"version": "0.1",
"manifest_version": 2,
"description" : "Improves MySite visual design to make the interface cleaner.",
"content_scripts" : [{
    "matches" : ["mysite.com/*"],
    "css" : ["style.css"]
  }]
}

错误内容如下:

“无法从 '/Users/colmtuite/dev/mysite-extension' 加载扩展。'content_scripts[0].matches[0]' 的值无效:缺少方案分隔符。”

4

1 回答 1

7

根据“匹配模式”文档,必须指定方案。您可以*用来表示“任何方案”、“任何子域”和“任何路径”:

*://*.mysite.com/*
于 2013-03-10T06:35:24.950 回答