wOxxOm
unread,May 27, 2023, 12:37:04 AM5/27/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, Patrick Kettner, Chromium Extensions, Browser Extenstion, Divya Rijhwani
>
as for function of get method it does return only result instead of result.key as mentioned in document.
The method returns `result` object that looks like {['key']: value} and this is the correct behavior. The documentation doesn't contradict it, so I guess you're not reading it correctly. However, the code in the documentation is unnecessarily convoluted/outdated, which makes it confusing judging by the regularly posted questions about this API on stackoverflow.
Simply use this:
async doSomething() {
const {token} = await chrome.storage.local.get('token');
async doSomething2() {
const {token1, token2} = await chrome.storage.local.get(['token1', 'token2']);