【问题标题】:Chrome extension content script not working on chrome webstore page [duplicate]Chrome 扩展内容脚本在 Chrome 网上商店页面上不起作用 [重复]
【发布时间】:2015-05-27 16:16:55
【问题描述】:

我有一个简单的 chrome 扩展,内容脚本应该在每个站点上执行,这适用于除此之外的所有站点:

https://chrome.google.com/webstore/developer/dashboard

它适用于任何其他网站(google、gmail、网上银行、stackoverflow)

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());

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2015-02-13
      • 1970-01-01
      • 2016-12-23
      • 1970-01-01
      • 1970-01-01
      • 2020-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多