Upgrading permissions of a Chrome Extensions Upgrading permissions of a Chrome Extensions google-chrome google-chrome

Upgrading permissions of a Chrome Extensions


Yes, there is solution.You set the new permissions as optional, and then you request the permission before the user using the new feature.The is work 100%.

This is what you add to your manifest:

"permissions": ["tabs","http://*/*","https://*/*"],

After that you can use:

chrome.permissions.request 

and

chrome.permissions.contains


Facing the same issue with my extension, I came about this post searching for the same question. There is an update that seems acceptable in some cases.According to:https://support.google.com/chrome_webstore/answer/1054246and the example on http://developer.chrome.com/extensions/permission_warnings.html

Seems that updating your permissions will in fact disable your extension, however it will prompt the user about your change and allow an easy "re-enable".

It might not be acceptable in your scenario, however in my case the win of new users with the added permission by default trumps the risk of existing user not re-enabling. As this is drastically better to the way it was before where your existing users were not aware of the extension being disabled...

I know this post is old, but as it is the top Google result for this question thought an update be good for future reference...


Since chrome 16 you can set optional_permission at install time and ask for elevated permission at run time. See https://developer.chrome.com/extensions/permissions

in manifest.json:

  {    "name": "My extension",    ...    "optional_permissions": [ "tabs", "http://bar.site.com/" ],    ...  }

in popup.json:

    document.querySelector('#my-button').addEventListener('click', function(event) {    // Permissions must be requested from inside a user gesture, like a button's    // click handler.    chrome.permissions.request({      permissions: ['tabs'],      origins: ['http://bar.site.com/']    }, function(granted) {      // The callback argument will be true if the user granted the permissions.      if (granted) {        doSomething();      } else {        doSomethingElse();      }    });  });