Pau*_*nel 8 google-chrome manifest internationalization google-chrome-extension content-script
对于Google-Chrome扩展程序,我想在所有Google网页上加载内容脚本.做这个的最好方式是什么?
我试过这个,manifest.json但它不起作用:
"matches": ["http://www.google.*/*", "https://www.google.*/*"],
Run Code Online (Sandbox Code Playgroud)
这"有效"但写起来有点长,我不认为这是最好的做法:
"matches": ["http://www.google.com/*", "https://www.google.com/*", "http://www.google.fr/*", "https://www.google.fr/*", "http://www.google.de/*", "https://www.google.de/*", etc..."],
Run Code Online (Sandbox Code Playgroud)
Bro*_*ams 17
请参阅匹配模式和globs.不幸的是,Google-Chrome在其matches规范中没有一个很好的顶级域名(TLD)机制.因此,http://www.google.*/*抛出错误并且不支持http://www.google.tld/*(Greasemonkey语法).
要解决此问题,请扩展matches参数并使用参数过滤结果include_globs.
像这样:
"matches": ["http://*/*", "https://*/*"],
"include_globs": ["http://www.google.*/*", "https://www.google.*/*"],
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
580 次 |
| 最近记录: |