Skip to Main Content

Hack Attack: Sync your Greasemonkey scripts across computers


by Adam Pash

Click to viewGreasemonkey is by far my favorite Firefox extension. It's the first extension I install on a new installation of Firefox, followed quickly by a slew of my favorite Greasemonkey scripts. The only problem that I've had with Greasemonkey in the past is that it's hard to keep my scripts in sync across all of the computers I work on, requiring me to duplicate work and installations across several computers.

Today I'll detail how to use the cross platform program FolderShare to keep your Greasemonkey scripts in perfect sync across your Firefox browsers and computers (Windows and/or Mac).

Greasewhatkey?

If you're not sure what's so special about the Greasemonkey Firefox extension, check out some of our favorite scripts to get an idea of just what it can do. My personal favorite is the Gmail Macros script, demonstrated here.

Sync your scripts with FolderShare

Step 1: Download and install FolderShare: Previously mentioned, cross-platform (Windows and Mac only) freeware app FolderShare lets you set up real-time syncs of files and folders on both Windows and Mac computers. What's more, your computers don't even need to be on the same network. So head over to FolderShare, download, and install the app. You'll also need to register with the FolderShare web site.

Step 2: Set up your sync: After you've installed FolderShare on the computers you want to sync, log in to your FolderShare account and click on Sync My Folders.

Now you need to specify the computers you want to sync and the folders you'd like to sync on each computer. So click "Specify folders to sync", choose the computer you're going to set up first, and click "Specify a folder". Now you just need to navigate through the web interface to your Firefox profile folder and your Greasemonkey scripts.

On a Windows computer, your Firefox profiles should be located at C:\Documents and Settings\user\Application Data\Mozilla\Firefox \Profiles. On a Mac, you can find your profile at ~/Library/Application Support/Firefox/Profiles.

FolderShare can be a little annoying at this point, since it makes you navigate the folders one at a time through the web interface, but once you've found your profile folder, you need to select the profile you want to use (if you only have one, it should look something like xxxxxxxx.default). Finally select the gm_scripts folder.

FolderShare will validate the folder and then ask you to set up another device. Choose your other to-be-synced computer(s) from the sidebar and repeat this step. When you're done setting up devices, you click Finish and name your "library" (I've called mine Greasemonkey sync). Unless you want to manually trigger syncs, leave the sync-type on Automatic Sync.

When you're all finished, click "Complete Setup and Start Syncing". FolderShare will whip into action and start syncing between your computers. You should see the FolderSync icon productively blinking away in your system tray or menu bar.

Step 3: Keep FolderShare running and let the syncing take care of itself: Now that FolderShare's set up, that's all you need to worry about it. Any time you install a new Greasemonkey script on one computer, it should almost instantaneously sync to your other computer(s). Any time you disable a script on a web site, your preferences should be reflected on your other computers. Easy peasy, and just what my Firefox installations needed.

Now that you've got your Greasemonkey scripts in sync across your browsers, don't forget to sync your bookmarks. We recommend Foxmarks over Google Sync, but either will do. You can even set up Foxmarks to back up your bookmarks to your own personal server.

While these two Firefox syncs (i.e., bookmarks and Greasemonkey scripts) still don't cover the elusive full Firefox extensions sync (for curiosity's sake, I tried syncing my entire profile folder with no luck), I'm getting ever-closer to keeping my Firefox browsers entirely in sync.

Adam Pash is a senior editor for Lifehacker to whom perfectly synced data keeps him productive no matter what computer he's working on. His special feature Hack Attack appears every Tuesday on Lifehacker. Subscribe to the Hack Attack RSS feed to get new installments in your newsreader.