I need a sync storage to be able to solve a problem and support version above and below 53. chrome.storage is async and you cannot get information in a sync way.
I think the only thing you can do is to file a bug on bugzilla. And waiting for a solution in next Firefox versions (maybe), I recommend you to verify the Android compatibility of each function you use on mozzila website. Sometimes, with localStorage for example, you will need to adapt your code with an alternative solution. For example :
//Browser compatibility
var browser = browser || chrome;
var android = !browser.windows;
if(android){
browser.storage.local.get(function(storage){
//Your Android code here
console.log(storage.test);
});
}
else{
//Your Desktop code here
console.log(localStorage.getItem("test"));
}
Unfortunately Extension Auto-Installer will only work for Firefox up to including version 56.
NilkasG:
Dammit
I need a sync storage to be able to solve a problem and support version above and below 53. chrome.storage is async and you cannot get information in a sync way.
log69:
I think the only thing you can do is to file a bug on bugzilla. And waiting for a solution in next Firefox versions (maybe), I recommend you to verify the Android compatibility of each function you use on mozzila website. Sometimes, with localStorage for example, you will need to adapt your code with an alternative solution. For example :
>
> //Browser compatibility
> var browser = browser || chrome;
> var android = !browser.windows; if(android){ browser.storage.local.get(function(storage){ //Your Android code here console.log(storage.test); });
> }
> else{ //Your Desktop code here console.log(localStorage.getItem("test"));
> }
That I am aware of But I can keep this code base just like in the case of desktop version 52 using only localStorage because sync is supported from 53 on. I tested and it works on 52. So my code fallbacks to local only if no sync available.
I’m curious if there will be any answer of how we can read the log for background scripts and I’m anxious to see what works on Android and what not from what I’d like to do. Still digging for answers…
I think you could solve your problem with sync vs async storage functions and Android miscompatibility with a more object-oriented approach. I created a pull request on your GitHub and tested it on Firefox and Chrome which worked well but not yet on Firefox Android