Theo Rulko
Theo Rulko

Reputation: 53

unlimitedStorage not supported by chrome optional permission API; How to update extension with the permission?

In order to release a new version of my Chrome extension with a new feature, I need to the use the Chrome unlimitedStorage permission in order to be able to store very long strings. However, this permission is not supported by the optional permissions API, so I cannot programmatically add the permission to the app. This means that I need to add it as a normal permission, which would result in the extension being disabled for all its users.
Since this is not an option, I am not sure how I can ship this update. Is there any way around the extension being disabled? Would you recommend creating a totally new version of the extension under a different name in the Chrome Webstore and asking users to migrate to that extension via a popup?

Also, if this information is necessary, the string that I am trying to store using the chrome.storage.local API is a data URI representing an image. I do not know specifically the length of the URI, as that depends on the size of the image uploaded by the user. So maybe it would be possible to compress this image under the maximum size per item of 8,192 bytes, as stated in this Chrome API reference.

EDIT
I just noticed that the unlimitedStorage permission is listed under "Permissions that don't cause warnings" on this Chrome extension API reference page: https://developer.chrome.com/extensions/permission_warnings#nowarning Does that mean that adding the permission to the manifest of the Chrome extension will not disable the extension? Can anybody confirm this?

Upvotes: 1

Views: 2234

Answers (1)

Xan
Xan

Reputation: 77541

I just noticed that the unlimitedStorage permission is listed under "Permissions that don't cause warnings" on this Chrome extension API reference page: https://developer.chrome.com/extensions/permission_warnings#nowarning Does that mean that adding the permission to the manifest of the Chrome extension will not disable the extension?

Yes, that is correct. You can add any of those permissions without existing installs being disabled.

Upvotes: 6

Related Questions