【发布时间】:2015-10-07 05:09:19
【问题描述】:
我发现这个对我的问题非常有用的答案,但它对我不起作用: Can an app or extension open files on system with permission "<all_urls>"?
这是我 manifest.json 的一部分:
...
"content_scripts": [
{
"matches": [<all_urls>], // tried also "file:///*"
...
"permissions": [
"activeTab",
"background",
"tabs",
"<all_urls>"
],
...
我还选中了我的 “允许访问文件 URL” 框。
当我打开本地 html 文件时,开发者工具中的内容脚本选项卡仍然是空的:///
为 http:// url 加载了扩展,没有问题。
任何人都知道是否还有更多或我错过了什么?
【问题讨论】:
-
<all_urls>inmatches应该用引号引起来。但我假设你实际上已经这样做了,这只是一个复制/粘贴错误,因为如果你的清单中有这个,Chrome 会抱怨。 -
它应该加载
"<all_urls>"+ 该复选框,除非您确实有上述错字。
标签: file google-chrome-extension schema content-script