[英]Will adding “chrome_url_overrides” to chrome extension, disable the extension to existing users?
我在chrome网上商店中有一个现有的chrome扩展名,下面提供了类似的manifest.json。
{
"manifest_version": 2,
"name": "Extension Name",
"short_name": "Short Name",
"description": "Some description",
"version": "1.0.83",
"icons" : {
"16": "something.png",
"32": "something.png",
"48": "something.png",
"96": "something.png",
"128": "something.png",
"512": "something.png"
},
"permissions": [ "tabs", "https://*/*", "http://*/*", "storage", "gcm" ],
"optional_permissions": [ "notifications", "webRequest", "webRequestBlocking" ],
"page_action": {
"default_icon": "styles/images/icon.png",
"default_title": "Name",
"default_popup": "popup.html"
},
"update_url": "https://clients2.google.com/service/update2/crx",
"content_security_policy": "script-src 'self' https://www.google-analytics.com https://d2xwmjc4uy2hr5.cloudfront.net; object-src 'self'",
"background": {
"scripts": ["scripts/jquery-2.1.1.min.js", "scripts/background.js"],
"persistent": true
},
"web_accessible_resources" : ["logo.png"],
"content_scripts": [
{
"js": ["scripts/jquery-2.1.1.min.js", "scripts/bigstuff.js"],
"run_at": "document_end",
"matches" : ["<all_urls>"]
}
]
}
现在,我想为用户定制新的标签页,这需要我修改清单并添加以下详细信息。
chrome_url_overrides": {
"newtab": "newtab.html"
}
添加此功能会禁用现有用户的扩展名吗?
Chrome不会禁用您的扩展程序(但请参见此答案的结尾!)。 仅当更新引入了新的权限警告时,才会禁用更新的扩展名(警告:此列表不完整)。
要查看新旧扩展生成的权限警告,请参见扩展清单中的chrome“ permissions”属性生成什么消息的答案?
以下注释摘自Chromium的源代码 ,摘录于检查是否可以在无需用户交互的情况下应用扩展更新的逻辑附近:
// We keep track of all permissions the user has granted each extension.
// This allows extensions to gracefully support backwards compatibility
// by including unknown permissions in their manifests. When the user
// installs the extension, only the recognized permissions are recorded.
// When the unknown permissions become recognized (e.g., through browser
// upgrade), we can prompt the user to accept these new permissions.
// Extensions can also silently upgrade to less permissions, and then
// silently upgrade to a version that adds these permissions back.
//
// For example, pretend that Chrome 10 includes a permission "omnibox"
// for an API that adds suggestions to the omnibox. An extension can
// maintain backwards compatibility while still having "omnibox" in the
// manifest. If a user installs the extension on Chrome 9, the browser
// will record the permissions it recognized, not including "omnibox."
// When upgrading to Chrome 10, "omnibox" will be recognized and Chrome
// will disable the extension and prompt the user to approve the increase
// in privileges. The extension could then release a new version that
// removes the "omnibox" permission. When the user upgrades, Chrome will
// still remember that "omnibox" had been granted, so that if the
// extension once again includes "omnibox" in an upgrade, the extension
// can upgrade without requiring this user's approval.
chrome_url_overrides
权限。 当我使用以下manifest.json
遵循上述步骤时,
{
"name": "Permission test",
"version": "1",
"manifest_version": 2,
"chrome_url_overrides": { "newtab": "manifest.json" }
}
然后,我得到一个没有任何警告的权限对话框(“此扩展不需要特殊权限。”)。 因此,如果您在更新中添加此清单密钥,Chrome(经过54或更早版本测试)将不会禁用您的扩展程序。
这并不意味着,你现在可以发布扩展不失用户。 用户经常查看“新标签”页面,如果您未经他们的同意对其进行更改,则用户如果希望重新获得对“新标签”页面的控制权,则可以删除您的扩展程序 。
并仔细查看Chrome Web Store的“ 单一用途政策” :例如,如果您开始用与扩展功能不相关的带有广告的页面替换NTP,则该商店可能会删除Chrome Web Store列表策展人 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.