我是靠谱客的博主 优雅水蜜桃,最近开发中收集的这篇文章主要介绍data:text/html chromewebdata,Unchecked runtime.lastError while running tabs.executeScript: Cannot ac...,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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 ] }

最后

以上就是优雅水蜜桃为你收集整理的data:text/html chromewebdata,Unchecked runtime.lastError while running tabs.executeScript: Cannot ac...的全部内容,希望文章能够帮你解决data:text/html chromewebdata,Unchecked runtime.lastError while running tabs.executeScript: Cannot ac...所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(68)

评论列表共有 0 条评论

立即
投稿
返回
顶部