当前位置: 首页 > 工具软件 > Textdown > 使用案例 >

data:text/html chromewebdata,Unchecked runtime.lastError while running tabs.executeScript: Cannot ac...

东方华晖
2023-12-01

I'm getting this error: extensions::lastError:133 Unchecked runtime.lastError while running tabs.executeScript: Cannot access contents of url "data:text/html,chromewebdata". Extension manifest must request permission to access this host.

I'm getting this error after disabling internet so that I can take action when the page load fails(due to heavy load) or internet down.

I've checked all similar questions and this almost similar but still unable to make it work. Another very similar one with comment that Chrome does not allow hijack of internal pages

My permissions looks like: "permissions": [ "tabs","unlimitedStorage", "notifications", "history", "activeTab", "storage", "webRequest", "webRequestBlocking", "*://*/*", "http://*/*", "https://*/*" ],

I get the error when I run this code: chrome.tabs.executeScript(null, {file: "showbacklink.js"});

or chrome.tabs.executeScript(details.tabId, {file: "showbacklink.js"});

where details.tabId is the active tab.

What am I missing?

Edited manifest.json { "name": "", "options_page": "options.html", "description": "", "version": "1.0", "icons": { "16": "icons/logo16.png", "48": "icons/logo48.png", "128": "icons/logo128.png" }, "permissions": [ "tabs","unlimitedStorage", "notifications", "history", "activeTab", "storage", "webRequest", "webRequestBlocking", "http://*/*", "https://*/*" ], "background": { "scripts": [ "showbacklink.js", "client_server_common.js", "common.js", "background.js" ], "persistent": true }, "content_security_policy": "script-src 'self'; object-src 'self'", "manifest_version": 2, "content_scripts": [ { "run_at": "document_end", "all_frames": true, "matches": ["https://*/*"], "css": [//REMOVED], "js": [ //other files REMOVED "myscript.js", ] }, ], "web_accessible_resources": [ //REMOVED ] }

 类似资料:

相关阅读

相关文章

相关问答