23

I've noticed that userscripts aren't automatically synchronized like (regular) extensions in Google Chrome.

Is there any way to ensure that userscripts are synchronized between Chrome installations?

Anderson Green
  • 6,452
  • 15
  • 52
  • 76
  • It appears that it's possible to create a Chrome extension from a Greasemonkey script: http://blog.justin.kelly.org.au/how-to-create-a-google-chrome-extension-from/ – Anderson Green Dec 15 '12 at 07:12
  • 1
    That blog post is obsolete. See [this answer](http://stackoverflow.com/questions/5258989/manually-adding-a-userscript-to-google-chrome/5259212#5259212) for more up to date information. Also, Chrome userscripts are auto-converted to extensions anyway. – Brock Adams Dec 15 '12 at 07:32
  • @BrockAdams In that case, is there any way to synchronize a userscript's locally stored data between Chrome installations? – Anderson Green Dec 15 '12 at 07:35
  • @BrockAdams I want to find some way to synchronize the local storage for Chrome userscripts. I wonder if it's possible to use `chrome.storage` in userscripts: https://developer.chrome.com/extensions/storage.html – Anderson Green Dec 15 '12 at 07:47
  • @BrockAdams Correction, the `chrome.storage` feature is also available in Content scripts if the `storage` permission is specified in the manifest file. – Rob W Dec 15 '12 at 08:54
  • @RobW, good to know. According to the docs, the storage permission must be set irregardless, for storage to work. – Brock Adams Dec 15 '12 at 09:59
  • (replacing earlier comments) I *think* that to sync extensions, they must be uploaded to Google's web store. For sharing data, `chrome.storage` just might work. If not, setting up a server, that your scripts can AJAX data to and from, would work. – Brock Adams Dec 15 '12 at 10:02
  • It seems that only extensions hosted on Chrome Web Store will be automatically synced. –  Dec 15 '12 at 10:36
  • You might install Tampermonkey, which is synched, and see if scripts installed with it are synched. They might be. – Brock Adams Dec 19 '12 at 00:53

1 Answers1

24

It is already possible to synchronize userscripts using the Tampermonkey extension for Google Chrome. To synchronize userscripts, go to the "settings" tab of Tampermonkey. Set "config mode" to "beginner" or "advanced", and then enable "Chrome Sync" under "TESLA".

Anderson Green
  • 6,452
  • 15
  • 52
  • 76
  • I enabled that option on both of my Chrome installations but it did not sync my script. – Nate May 20 '14 at 14:18
  • 4
    Tampermonkey will only sync external scripts – ElephantHunter Jun 19 '14 at 19:40
  • 6
    A simple way to store your userscripts externaly and keep them in sync is to store them in Dropbox and then share them. Once Dropbox gave you the share URL, just replace the parameter `?dl=0`by `?dl=1` which will serve the file instead of showing it. Then, in your userscript header, just add `@downloadURL https://www.dropbox.com/s/......./usercript_example.js?dl=1`. Don't forget to increment the `@version` so that TamperMonkey will detect the update. – Patrick Janser Feb 05 '16 at 12:03
  • https://superuser.com/questions/506221/how-can-i-share-tampermonkey-scripts-between-versions-of-chrome/1453402#1453402 – Smart Manoj Jun 27 '19 at 02:23