Chrome扩展程序内容脚本无法在chrome webstore页面上运行

时间:2015-05-27 06:36:50

标签: javascript google-chrome google-chrome-extension

我有简单的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());

1 个答案:

答案 0 :(得分:2)

Chrome浏览器扩展程序不允许在Chrome商店页面上运行。 原因 - 显然是安全。恶意扩展可以操纵对官方chromestore页面的访问。

Notice no content script injected on chromestore page