簡體   English   中英

會在chrome擴展程序中添加“ chrome_url_overrides”,從而禁用現有用戶的擴展程序嗎?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM