On Firefox, values stored with storage.sync
are readable after you uninstall and re-install the extension. It is available even if you don't setup Firefox Sync. For example:
manifest.json:
{
"name":"foo",
"version":"1",
"manifest_version": 2,
"background": {
"scripts": ["background.js"]
},
"permissions": ["storage"],
"browser_specific_settings": {
"gecko": {
"id": "counter@example.com", <= this is required to keep values after reinstalling
"strict_min_version": "68.0"
}
}
}
background.js:
chrome.storage.sync.get({ foo: 0 }, result => {
console.log('count: ', result.foo); <= You will see this value is kept and increased even after you reinstall this extension.
chrome.storage.sync.set({ foo: result.foo + 1 });
});
Sadly this doesn't work on Chrome for me with a testing local extension, even if you've configured your Google account. Chrome looks to not provide any mechanism to identify an extension across multiple time installations.