question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello! Congrats for the repo!

Will you add suppport to chrome.storage API?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
KeithHenrycommented, Aug 7, 2018

@sag1v I have a near identical call to const options = await chrome.storage.sync.get({ ... }) in a production Chrome add-in that’s working fine. My guess would be that the API mapping call is either not running, or running in a context where it doesn’t have access to the chrome.storage.sync instance yet.

Could you provide more information?

1reaction
qpongocommented, Jun 28, 2018

It works for me in both Chrome and Opera – both use the “chrome” api.

It doesn’t work in Edge which uses browser but doesn’t seem to allow overriding of the methods (yet).

await browser.storage.local.set({key: 'value'});
let val = await browser.storage.local.get('key');
// val = {"key": "value"}
console.log(val.key);
// "value"
Read more comments on GitHub >

github_iconTop Results From Across the Web

chrome.storage - Chrome Developers
Holds data in memory for the duration of a browser session. By default, it's not exposed to content scripts, but this behavior can...
Read more >
Chrome Storage
Chrome Extension Extension provides CustomEvents to access Chrome Storage from a JS on a Page Usage: ChromeStorage:Ready fired when Chrome ...
Read more >
chrome.storage - Google Chrome - GitHub Pages
Description: Use the chrome.storage API to store, retrieve, and track changes to user data. Availability: Since Chrome 35. Permissions: "storage".
Read more >
Chrome extensions: Local storage - DEV Community ‍ ‍
The chrome.storage API allows us to store objects using a key that we will later use to retrieve said objects. This API is...
Read more >
use-chrome-storage - npm
Custom React hooks for `chrome.storage.` You may use it for keeping global persisted state in chrome extensions.. Latest version: 1.0.8, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found