请帮帮我!我收到错误Unchecked runtime.lastError: Cannot access contents of url. Extension manifest must request permission to access this host.并且Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.我在 google chrome 清单 3 中
来自内容脚本的监听器
chrome.runtime.onMessage.addListener(
function(req, sender, sendResponse) {
if(req.msg === "analysis background") {
let obj = parse();
sendResponse(obj);
}
return true;
}
);
);
Run Code Online (Sandbox Code Playgroud)
清单.json
{
"manifest_version": 3,
"name": "extensionParser",
"version": "1.0.0",
"action": {
"default_popup": "popups/popup.html"
},
"background": {
"service_worker": "background.js"
},
"permissions": ["tabs", "scripting",
"http://localhost/site_for_parsing"]
} …Run Code Online (Sandbox Code Playgroud)