browser.storage.local.set({
config1: {
“captchaUrl”: “://xxx.xxx.com/get_img”,
“content_script”: “site.js”
}
});
browser.storage.local.get().then(settings => {
let config2=settings[“config1”];
// block02, do something with config here
console.log(config2);
});
Is it guaranteed that the config2 would always get an object rather than undefined?? Or is there an order guarantee that the the storage.get() method above will get the data set by the storage.set() which is followed by storage.get() ?
I have made a test but I coundn’t find any documentation about this.