我有简单的chrome扩展,内容脚本应该在每个站点上执行,这适用于除此之外的所有站点:
https://chrome.google.com/webstore/developer/dashboard
适用于任何其他网站(谷歌,Gmail,网上银行,堆栈溢出)
的manifest.json:
{
"manifest_version": 2,
"name": "Chrome extension not working on one site",
"short_name": "cenwoos",
"description": "This chrome extension does not work on chrome webstore site, the content script simply will not be executed.",
"version": "0.1.0",
"minimum_chrome_version": "38",
"permissions": [
"http://*/*",
"https://*/*"
],
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["content.js"]
}
]
}
content.js:
alert('this alert will not be displayed on chrome webstore page');
console.log('This is content script on url:', document.location.toString());
答案 0 :(得分:2)
Chrome浏览器扩展程序不允许在Chrome商店页面上运行。 原因 - 显然是安全。恶意扩展可以操纵对官方chromestore页面的访问。