Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome 将扩展内容脚本绑定到Chrome';什么是起始页?_Google Chrome_Google Chrome Extension_Content Script - Fatal编程技术网

Google chrome 将扩展内容脚本绑定到Chrome';什么是起始页?

Google chrome 将扩展内容脚本绑定到Chrome';什么是起始页?,google-chrome,google-chrome-extension,content-script,Google Chrome,Google Chrome Extension,Content Script,有没有办法将内容脚本绑定到Chrome的起始页 我尝试将匹配设置为“*”,但它甚至没有运行。使用“*://*/*”它不会绑定。不,您不能*。从技术上讲,起始页是chrome://newtab/,并且Chrome扩展无法访问Chrome://页面,这是出于安全原因,即使使用最宽的”,但很难复制所有默认功能(例如顶级网站的缩略图) *可以使用Chrome标志启用此功能:chrome://flags/#extensions-在chrome URL上,但这仅适用于扩展为个人使用且存在潜在安全风险的情况

有没有办法将内容脚本绑定到Chrome的起始页


我尝试将
匹配设置为
“*”
,但它甚至没有运行。使用
“*://*/*”
它不会绑定。

不,您不能*。从技术上讲,起始页是
chrome://newtab/
,并且Chrome扩展无法访问
Chrome://
页面,这是出于安全原因,即使使用最宽的
”,但很难复制所有默认功能(例如顶级网站的缩略图)


*可以使用Chrome标志启用此功能:
chrome://flags/#extensions-在chrome URL上
,但这仅适用于扩展为个人使用且存在潜在安全风险的情况。

是的!chrome的起始页(?现在?)包含表单的隐藏URL:

https://www.google.com/_/chrome/newtab?espv=2&ie=UTF-8
以及带有
manifest.json
s的扩展,如:

{
“清单版本”:2,
“内容脚本”:[{
“js”:[“HelloWorld.js”],
“匹配项:”
} ],
“名称”:“Chrome启动测试”,
“说明”:“在Chrome起始页上运行”,
“版本”:“1”
}
…在起始页上运行良好