将扩展内容脚本绑定到Chrome的首页? [英] Binding extension content scripts to Chrome's start page?
问题描述
我试着将匹配
设置为,以便将内容脚本绑定到Chrome的开始页面*
,但它甚至没有运行。使用*:// * / *
它不会绑定。
不,你不能*。从技术上讲,开始页面是 chrome:// newtab /
,Chrome扩展程序无法访问 chrome://
页面安全的原因,即使是最广泛的< all_urls>
权限。 您唯一的希望是< 制作你自己的新标签页,虽然它很难复制所有的默认功能(例如缩略图 $ b
*可以通过Chrome Flags启用此功能: chrome:// flags /#extensions-on-chrome-urls
但这只适用于扩展名为个人使用且潜在的安全风险。
Is there any way to bind a content script to Chrome's start page?
I tried setting matches
to "*"
, but it doesn't even run. With "*://*/*"
it does not bind.
No, you cannot*. Technically, the start page is chrome://newtab/
, and Chrome Extensions cannot access chrome://
pages for security reasons, not even with the widest "<all_urls>"
permission.
Your only hope is to make your own New Tab page, though it would be hard to replicate all of the default functionality (e.g. thumbnails of top sites).
* One can enable this with Chrome Flags: chrome://flags/#extensions-on-chrome-urls
But this is only applicable if the extension is for personal use and is a potential security risk.
这篇关于将扩展内容脚本绑定到Chrome的首页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!