Reputation: 21843
I am using chrome.storage.sync
in an extension to sync data entered in a textarea in a popup.html
.
It stores and restores the data correctly locally but it does not sync the data across browsers.
Each browser extension has its own locally entered data available.
The following code is used to save and restore the data:
// Called when the user opens popup.html
$(window).ready(
function restore() {
var textarea = document.querySelector("#contacts");
chrome.storage.sync.get('contacts', function(r) {
console.log("Contacts retrieved");
var content = r["contacts"];
textarea.value = content;
});
});
// Called when user saves his changes to the textarea
$("#save-button").click(function() {
var textarea = document.querySelector("#contacts").value;
var save = {};
save["contacts"] = textarea;
// Save data using the Chrome extension storage API.
chrome.storage.sync.set(save, function() {
console.log("Contacts saved");
});
$("#confirm").text("Contacts saved.").show().fadeOut(5000);
});
In my manifest.json
I grant permissions to storage
:
"permissions": [
"tabs",
"http://*/*",
"storage"
]
}
What is the reason for Chrome Sync not syncing across browsers and devices?
Upvotes: 3
Views: 2500
Reputation: 605
Credit to "方 觉" who commented on Aug 2, 2013 at 6:01.
Go to chrome://sync and you'll be able to see list of Extensions being synced and when.
Upvotes: 0
Reputation: 16
it seems that Google Storage API has some limitations, the number of synchronizations per minute and the weight of the items to synchronize. I found this : http://www.developer.com/lang/synchronized-storage-between-multiple-computers-with-chrome-sync.html
I hope it will help ;)
Upvotes: 0
Reputation: 6169
Is your extension uploaded to your Chrome Web Store account and published (or at least published to your testers)?
Cross-computer sync doesn't work on non-Web Store extensions last I checked, so you have to put it on the Chrome Web Store to test.
You also have to make sure Extensions is checked under chrome://settings/syncSetup
.
Upvotes: 5