Search code examples
google-chromegoogle-chrome-extensionchrome-web-store

Will adding "chrome_url_overrides" to chrome extension, disable the extension to existing users?


I have an existing chrome extension in chrome web store with a similar manifest.json given below.

{
    "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>"]
        }
     ]
}

Now I would like to customize the new tab page for the user, which requires me to modify the manifest and add the following details.

chrome_url_overrides": {
    "newtab": "newtab.html"
}

Will adding this disable the extension for the existing users?


Solution

  • Your extension won't be disabled by Chrome (but see the end of this answer!). An updated extension is only disabled if the update introduces new permission warnings (warning: this list is incomplete).
    To see what permission warnings are generated by the old and new extension, see the answer to What message is generated by the chrome “permissions” property in an extension manifest?

    The following comment is an excerpt from Chromium's source code, near the logic that checks whether an extension update can be applied without user interaction:

    // 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.
    

    The chrome_url_overrides permission.

    When I follow the above steps with the following manifest.json,

    {
        "name": "Permission test",
        "version": "1",
        "manifest_version": 2,
        "chrome_url_overrides": { "newtab": "manifest.json" }
    }
    

    Then I get a permission dialog without any warnings ("This extension requires no special permissions."). So Chrome (tested with 54 and earlier) will not disable your extension if you add this manifest key in an update.

    That does not mean that you can now publish the extension without losing users. The New Tab page is frequently viewed by users, if you change it without their consent, then the users may remove your extension if they want to regain control over their New Tab page.

    And carefully review the Single Purpose Policy of the Chrome Web Store: If you, for example, start replacing the NTP with an advert-laden page that is not related to your extension's functionality, the Chrome Web Store listing may be taken down by the store curators.