I just created a simple add-on with the SDK. I installed it and the icon shows up and everything works at once without a restart of firefox. Then I removed the add-on using the Add-ons Manager of firefox. After that I closed and reopened firefox and installed the add-on again and the Manager shows that the installation was successful. No error messages. But the icon doesn't show and nothing works.
The firefox console and the sdk console show no errors. My add-on stores one boolean in the sdk/simple-storage. Then I made a reset of firefox and installed it again and everything works fine.
Do you know, what causes this problem and how to solve it without resetting of firefox?
In my experience, reinstalling an add-on with the same version number is considered a downgrade
. So save the version number in simple-storage then
const self = require('sdk/self');
const {storage} = require('sdk/simple-storage');
if (storage && storage.version===self.version && self.loadReason==='downgrade')
storage = {};
Caveats:
downgrade
but an enable
.