awesome-emoji-picker icon indicating copy to clipboard operation
awesome-emoji-picker copied to clipboard

Finally test managed storage

Open rugk opened this issue 5 years ago • 5 comments

Tracked/tested in https://github.com/rugk/offline-qr-code/issues/177

Guide is currently written for that other add-on, but can be adjusted for this one. (most is just the same)

rugk avatar Apr 02 '19 20:04 rugk

Note that this code block does NOT work in Chrome: https://github.com/TinyWebEx/AutomaticSettings/blob/26c51c6ac40171731f11ec4855a93c591811e301/internal/LoadAndSave.js#L167-L178 and thus blocks #54. It causes all the settings to be identified as managed, which effectively disables the options page: image

A simple solution is the replace that block with return Promise.reject();, which makes the options page work, but obviously disables the managed options feature.

tdulcet avatar Oct 03 '20 04:10 tdulcet

Uhhh, that is unfortunate. The problem seems to be Chrom/ium only supports the sync and local settings storage, i.e. no managed at all.

The question is just, why does browser.storage.managed then succeed in Chrome/ium? Should not it throw an error? But well, the fix would then be a browser check and disable that feature for that browser. Or better maybe "polyfill" the browser.storage.managed API, so it throws an NotImplemented exception or so…

rugk avatar Oct 03 '20 16:10 rugk

Uhhh, that is unfortunate. The problem seems to be Chrom/ium only supports the sync and local settings storage, i.e. no managed at all.

No, Chrome does support managed storage (also see here). That was the first thing I checked when I noticed this issue... 🙂

BTW, there is a link to try it in Chrome at the bottom of this comment. Just rename the chromemanifest.json file to manifest.json.

tdulcet avatar Oct 04 '20 10:10 tdulcet

Hmm ok, so what's the issue in Chrome/ium then… maybe the fact that we use Promises is bad and it needs this polyfill?

rugk avatar Oct 04 '20 10:10 rugk

I am not sure, something in that code block... I stopped debugging it after I found that workaround, which allowed me to finish testing this extension in Chrome. I did use the WebExtension polyfill, as nothing would have worked without that.

tdulcet avatar Oct 04 '20 12:10 tdulcet