Reputation: 10360
Here is my situation: I have written a number of Chrome userscripts for my personal use. Previously, I only had one machine with one instance of Chrome on it, so I was perfectly happy to dump any persistent data into localStorage.
However, I now have multiple machines, and want to use my userscripts on Chrome on all the machines, with my persistent data coming along for the ride. Synchronizing the userscript code itself is straightforward if a bit tedious (stick it in a Bitbucket repo, then pull and manually install), but I have no idea how to synchronize my localStorage data across machines.
I have considered converting my userscripts to proper Chrome extensions and using the chrome.storage API (data stored using chrome.storage.sync apparently can be sync'd if you have a Google account connected to your Chrome instances, which I do). However, here is the issue with that for my use case:
So: is there some way for me to either 1.) sync localStorage across machines directly, or 2.) use the chrome.storage.sync API without a publically published Chrome extension?
Upvotes: 22
Views: 12203
Reputation: 9
A Google account comes with 15Gb of storage. Gmail, Google Docs, Google Tasks, Google Calendar, Google-Drive and chrome.storage ALL get packed into that 15Gb of Google Bucket space. More than 15Gb, if go big with Google One :) .
Extensions like "Tabs Outliner" stores a significant amount of data (on my desk, 10,000+ nested HTML lists/href list items) in ?localStorage? ... and up to 1000 backups in a Google-Drive folder, which appears private to the extension. i.e It is essentially a bottomless private folder for the Extension.
The downside: Tabs Outliner requires you to login to Google to sync the account on each machine you deploy to ... and (I think) each time there is an extension update. But publishing your extension (even privately) on CWS means that the publically registered Extension ID is recognised in your Google profile; and automatically deployed/updated from the CWS to ANY Chrome Browser where you've logged in with your Google Account. The Sync with Google-Drive is just a login away, but there may even be answers for that. (No promises ... the guy that wrote Tabs Outliner is pretty savy).
Apologies, I know this is lacking in detail. I'm considering picking up Tabs Outliner if it's Ukraine developer doesn't come back anytime soon (tumbleweeds for a few years to a paid community, but perhaps he has more pressing problems). I'm fumbling in the dark a little myself, but there area MANY good extensions - most with github source that you can view freely - which offer a model for the things we try to do.
HTH.
Upvotes: 0
Reputation: 10360
This doesn't really answer the question as I originally asked it, but this is what I ended up doing to solve the problem described above, so whatever.
"unlimitedStorage"
permission in the extension manifest. PouchDB's storage model is significantly superior to the chrome.storage storage model in basically every way (free revision tracking, a documented sync protocol rather than whatever voodoo chrome.storage.sync does, etc.), and the downsides (an extra dependency, need for a separate remote server [see below], etc.) were not a huge issue for me.Upvotes: 15