中的访问扩展chrome://extensions页
Access extensions in the chrome://extensions page
这是我的mainfest.json
:
"content_scripts": [ {
"all_frames": true,
"css": [ "css/event.css" ],
"matches": [ "'u003Call_urls>" ],
"run_at": "document_start"
}
但在chrome://extensions/
页面中找不到内容脚本
帮助
您可以在PC上通过启用chrome://flags/#extensions-on-chrome-urls
并在manifest.json中的"matches"
中添加必要的url chrome://extensions/
来完成此操作,但由于无效的方案错误,无法在普通浏览器上安装此类扩展。
为了避免致命错误,不要使用manifest.json注入内容脚本/样式,请在后台手动执行,或通过chrome.tabs.insertCSS
或chrome.tabs.executeScript
:弹出脚本
chrome://flags
:启用Extensions on chrome:// URLs
标志-
manifest.json:
"permissions": ["chrome://*/*", "tabs"], "background": { "scripts": ["background.js"] },
-
background.js:
var chromeURLstylable; chrome.permissions.contains({origins: ["chrome://*/*"], permissions: ["tabs"]}, function(state) { chromeURLstylable = state; console.log("chrome:// urls support", state); if (chromeURLstylable) { chrome.tabs.onUpdated.addListener(function(tabId, info, tab) { if (info.status == "loading" && tab.url.indexOf("chrome://") == 0) { chrome.tabs.insertCSS({ file: "style.css", runAt: "document_start", allFrames: true }); } }); } });
请注意向Chrome网上商店提交此类扩展时可能出现的问题。
相关文章:
- Chrome WebKitGetUserMedia
- JQueryhide()不适用于Mozzilla,但适用于Chrome
- 在chrome.tabs.onCreated之后加载HTML页面
- chrome扩展中的navigator.geolocation.getCurrentPosition
- chrome扩展:尽管运行了at:documentidle,js脚本还是过早启动
- document.open/document.write没有正确地清除chrome中的文档——这是chrome的错误吗
- chrome扩展更改主机/域警告
- Chrome开发工具(如何知道我在调用哪个javascript对象)
- 如何在chrome扩展中重定向到html页面
- Chrome Extensions and Cookies
- chrome.extensions对象不可用
- PayPal捐赠按钮在 chrome://extensions/ 中不起作用(选项V2)
- 如何在Google Chrome Extensions中使用jQuery ajax
- 关于在 Chrome 中调用 Chrome API 或 Chrome Extensions with Javascrip
- Chrome Extensions - Javascript
- 如何在Google Chrome Extensions中加载jQuery
- 中的访问扩展chrome://extensions页
- CMD+R不再工作在chrome://extensions/
- Chrome vs. Firefox Extensions
- jQuery and Chrome Extensions