Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to synchronize Chrome extension data on different computers?

Tags:

I have an extension where users maintain a list of links. It would be nice to have this data synchronized between computers (at work and at home). What are the possible solutions?

Chrome has extension synchronization option but I am not sure if it synchronizes data or not (I would be surprised if yes). Even if it does, not everyone would want all their other extensions be synced.

I can store my links in a special bookmark folder and use built-in bookmark synchronization, but in this case all bookmarks would be synchronized too (not all users would want that either I think).

Any external sites I can use? Something easy to use and linked to a google account?

(I don't want to build my own site for this)

like image 926
serg Avatar asked Feb 04 '11 17:02

serg


People also ask

Does Google Account sync extensions?

Your settings and data are synced to your Google Account. This way, your saved settings will be ready when you sign in to the same account on a different Chromebook. If your Chromebook is stolen or broken, you can get back your history, settings, data, bookmarks, apps, extensions, and themes just by signing in again.

Does Chrome history sync across devices?

When you sync. You can see and update your synced info on all your devices, like bookmarks, history, passwords, and other settings. You'll sign in automatically to Gmail, YouTube, Search, and other Google services. If you were signed in before turning on sync, you'll stay signed in.

How do I transfer Chrome extensions to another account?

Transferring the extension is as simple as copying or moving the folder from the original user's folder to the target user's folder.


2 Answers

Edit: As of Chrome 20 and above you can use chrome.storage module to save to the cloud.

chrome.experimental.storage.sync.set({'settingAlwaysOn': true}, function() {   console.log('Saved option in the cloud'); }); 

Before Chrome 20

You're right, the Chrome Sync for extensions options (in settings) does not synchronize extension data. The only way to synchronize those data is through a third party.

Since you ruled out the usage of Bookmarks, which makes sense if users don't want bookmarks to be synchronized.

Everytime you persist data through storage (Web SQL Storage, localStorage, IndexDB), you grab that object, and serialize it into JSON (via JSON.stringify), and you send it to some online service such as Google Docs.

That would be quite tricky for Web SQL Storage and IndexDB, you would have to do your own importer and exporter. For localStorage it is pretty simple, since its a key/value pair.

It requires some work to link it to a Google Account (such as Docs) you would have to use OAuth and do the plumbing to connect your extension to the service. Once your connected, it is not that difficult to maintain the state.

Good luck :)

like image 74
Mohamed Mansour Avatar answered Oct 04 '22 02:10

Mohamed Mansour


Chrome 20 supports chrome.storage.sync API. It seems to fit your requirements perfectly.

like image 27
NVI Avatar answered Oct 04 '22 01:10

NVI