问题
I'm trying to port Chrome extension to Firefox and I would like to know what's the equivalent to chrome.storage.local.set
and chrome.storage.local.get
in Firefox add on sdk. I think, it's simple-storage
.
Here is my code :
chrome.storage.local.set({'tokenFU': token});
[...]
chrome.storage.local.get('tokenFU',function(result){
token=result.tokenFU;
if(token && token != 'undefined'){
hideLog();
}
else
showLog();
});
Thanks in advance !
回答1:
Yes exactly, it is simple-storage. You can use it like this :
const storage = require("sdk/simple-storage").storage;
storage.tokenFu = token;
来源:https://stackoverflow.com/questions/17142991/porting-chrome-extension-to-firefox-equivalent-to-chrome-storage