Switch branches/tags
Nothing to show
Find file History
Pull request Compare This branch is 1108 commits behind GoogleChrome:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README.md
app.js
index.html
main.js
manifest.json
style.css

README.md

Hello World storage.sync

Use chrome.storage.sync to share small chunks of data among all of your Chrome devices. To test, open this app in two different devices, both signed in with the same user.

Important: needs "key" in manifest.json to support testing outside of CWS, so that sync storage is shared among different instances.

// app.js
chrome.storage.sync.set({"myValue": newValue}, mycallback);
...
chrome.storage.onChanged.addListener(
  function(changes, namespace) {
    // do something
  }
);
...
chrome.storage.sync.get("myValue", 
  function(val) {
    // do something
  }
);

APIs