Hi,
I am developing a WebExtension version of one of my add-ons. My add-on is currently a SDK based add-on. In the WebExtension world there is a runtime.onInstalled event and a previousVersion property. Does this work for updates from SDK to WebExtension?
Example: The SDK add-on has the version number 6.0.0, the WebExtension version will have the version number 7.0.0.
If I do something like:
const addon = {
onInstalledHandler (details) {
if (details.reason === 'update' && parseFloat(details.previousVersion) < 7) {
// do something
}
},
}
browser.runtime.onInstalled.addListener(addon.onInstalledHandler);
… does this work? Is details.previousVersion defined and contains the version number 6.0.0?
(it’s not about data migration, I won’t migrate any data. I want to show a compat notice for users of the old version and don’t show it for new users)
I have a second questions and that’s why I have to ask the first question: how can I test the update from SDK to WebExtension?