Updating users from SDK-based extension to WebExtension

How to access simple-storage from WebExtensions code?

Context: our extension (Ghostery) is posted in Mozilla store, and is SDK-based. Currently we’ve ported code to WebExtensions API. We plan to upgrade our users once Firefox 49 is out. The problem is the transfer of user settings during upgrade. In the SDK based app user settings are saved in simple-storage. We need a read-only access to it from a WebExtensions based code.

I don’t hear it’s possible. Unfortunately, some add-ons might send user data to 3rd party servers only to do that, which is not nice for privacy.

There are plans to let you “embed” a WebExtension within your extension and have them communicate. I hope it will land soon, but it is currently still under review: https://bugzilla.mozilla.org/show_bug.cgi?id=1252215

Well, the chrome.storage is stored as plain JSON in a file. As a SDK add-on, you can write files.

On my Windows system the file is:
C:\Users\<name>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile>\browser-extension-data\@<extension>/storage.json

Thank you Nilkas. Concerning deployment it means that we have to release
SDK-based hotfix to our existing users before posting an WebExtension-
based version. We were trying to avoid that. Look like, however, it is the
only strategy available.

Just an afterthought. I think the upgrade problem Ghostery facing may be generic enough. Can it be possible to add an API on chrome, like getMySimpleStorage which gives read-only access to the running app’s legacy simple storage? Does not need to expose Component, classes or interfaces to WebExtension code, just a high-level API. It may be documented as a temporary solution and removed once the support for SDK-based apps is retired.