【发布时间】:2018-08-28 12:34:36
【问题描述】:
因此,我正在开发一个 Chrome 扩展程序,该扩展程序需要在具有域 example.extension 的任何站点上激活,其中 extension 可以是任何东西(.com、.de 等)。
我有一个内容脚本,并在manifest.json 中包含了一个又一个列出的所有域名:
"content_scripts": [{
"js": ["content.js"],
"matches": ["https://www.example.com/*","https://www.example.de/*"]
}]
但是我怎么能写出匹配 example.* 的东西而不是枚举它们呢?
请注意,我尝试过这样的事情,但它不起作用:
"content_scripts": [{
"js": ["content.js"],
"matches": ["https://www.example*"]
}]
【问题讨论】:
-
您可以在清单中使用 include_globs,请参阅文档和Chrome extension: Run on all google domains and a specific page
标签: google-chrome google-chrome-extension content-script