3 ms·
Last time I tried to test an extension on Firefox, with or without web-ext, two things of note: 1. yarn add web-ext fails with a bunch of errors on macOS 10.15
by oefrha 6y ago
Last time I tried to test an extension on Firefox, with or without web-ext, two things of note:
1. yarn add web-ext fails with a bunch of errors on macOS 10.15, but npm install works. Not sure why.
2. The chrome.storage (or is it only storage.sync? can’t recall) API doesn’t work when the extension is loaded temporarily (since there’s no stable extension ID assigned or something), which is how `web-ext run` loads the extension, and the only way I could find to test the extension without submitting it to Mozilla for signing. Yeah I tweaked all the related settings in Firefox Developer Edition but couldn’t for the life of me figure out how to non-temporarily install my unsigned extension. So in the end I just gave up on testing the part of the extension that used chrome.storage, which was like 75% of the extension. A really hostile experience that will make sure I don’t port my extensions to Firefox in the future.
- karlicoss 6y agoI think it's storage.sync. I get a warning about it too, but just ignored it so far. I think it's just the actual sync that doesn't work (settings still get set and loaded locally).
- oefrha 6y agoOkay, I pulled out the code and ran it on Firefox again to jog my memory. This is the error when doing anything with chrome.storage.sync: Error: The storage API will not work with a temporary addon ID. Please add an explicit addon ID to your manifest. For more information see https://bugzil.la/1323228. It's an error, not a warning, and set/get definitely don't work. If I replace all storage.sync invocations with storage.local then it's okay, not error/warning, and setting/getting seems to work. So the problem is limited to storage.sync, but it's not just a warning. Edit: now that I googled the problem again, it seems adding an explicit addon ID according to https://extensionworkshop.com/documentation/develop/extensions-and-the-add-on-id/ https://extensionworkshop.com/documentation/develop/extensio... should work. I don't recall what I did back then, but I definitely did quite a few things to no avail.
- karlicoss 6y agoHmm I checked and I also have this bit of code I added a while ago to the manifest for non-release builds [0]: browser_specific_settings = {'gecko': {'id': 'promnesia@karlicoss.github.com'} } Maybe this is what makes it just a warning (still not sure why it warns!). [0] https://github.com/karlicoss/promnesia/blob/b9e59262b2fc51ef526248ba273436b0debdedaa/extension/webpack.config.js#L144-L152 https://github.com/karlicoss/promnesia/blob/b9e59262b2fc51ef... Definitely agree that the docs could be improved on web extension development & testing in general, I often feel the whole ecosystem is a bit hostile.
- oefrha 6y ago> browser_specific_settings Yeah I noticed that's the answer when I googled the error just now. Not sure why I didn't see it or it somehow didn't work at that time, the information should have been available (I encountered the problem late last year). It's certainly misleading that the error message links to a bug, at least giving the impression that it is a bug, rather than a guide. That said, IMO the underlying issue that Firefox doesn't allow you to just install an extension from a source directory like Chrome/Chromium does is much worse.
- deleted 6y ago[deleted]
- bamboleo 6y agoI read this before but I never encountered it before. Sync Storage works just fine, you just need to add the gecko extension ID to the manifest as described by other comments.