我正在尝试从我的内容脚本访问chrome.runtime.getBackgroundPage()
,但我得到:
未捕获的TypeError:chrome.runtime.getBackgroundPage不是函数(匿名函数)@ VM11844:1InjectedScript._evaluateOn @ VM11665:883InjectedScript._evaluateAndWrap @ VM11665:816InjectedScript.evaluateOnCallFrame @ VM11665:942window.onload @ run.js:101 < / p>
这是我的manifest.json的样子:
{
"background": {
"scripts": ["background.js"],
"persistent": true
},
"content_scripts": [{
"matches": ["<all_urls>"],
"js": ["run.js"],
"run_at": "document_start"
}],
"description": "Hello world!",
"homepage_url": "https://tryprospect.com",
"icons": {
"16": "icons/16x16.png"
},
"manifest_version": 2,
"name": "Hello world",
"permissions": ["storage", "management"],
"version": "v0.1",
"web_accessible_resources": ["html/*"]
}
我错过了什么吗?也许是许可?
谢谢!