例如:
chrome.storage.sync.get(resp => console.log(resp['Am I from RAM or disk?'])
“缓存”响应以加快访问速度是一种好习惯吗?例如:
const storageSync = {};
chrome.storage.sync.get(resp => storageSync['key'] = resp['key']);
someAction(storageSync['key']);
anotherAction(storageSync['anotherKey']);
foobar(storageSync['xxxxxxx'])
// And use in other parts of the code also
还是每次需要获取价值时都可以使用此API?
对于将来的访问者-文档链接(当前没有有关RAM的信息): https://developer.chrome.com/extensions/storage
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage