Using bookmark synchronization on Google Chrome for Linux and Mac

For a long time, I blamed the sluggish performance of the web browser on my Linux machine at home on the ancientness of the hardware.  However, when my much nicer Linux machine at work showed the same problem, I began to think maybe it was just Firefox.  I’ve been an avid Firefox user for many years, but my loyalty wavers when my browser can’t keep up with my keyboard.  Based on the advice of strangers on the Internet, I decided to give Google’s Chrome browser a try.

Chrome is still a maturing browser, but it is fast and capable.  There’s only one real drawback: bookmark synchronization.  With Firefox, I had been using Xmarks to synchronize my bookmarks, but that’s not currently available for Chrome.  In the “Early Access” builds of the Linux and Mac versions of Chrome, the bookmark sync that the Windows version has is available.  This syncs the bookmarks to your Google Docs account, which makes it rather handy.  However, synchronization is not enabled by default.  To enable it, you have to pass the –enable-sync option at launch time, which is easier said than done.  Fortunately, it’s not too terribly difficult.

Enabling sync on Mac

Assuming you’ve downloaded the Mac .dmg from the Chrome website, and copied “Google Chrome” into the Applications folder, all you need to do is create an AppleScript that launches Chrome with the –enable-sync option.  To do that, just follow the steps here:

  1. Open “AppleScript Editor” in Applications -> Utilities
  2. In the upper box of the Editor, add the following line:
    do shell script "open '/Applications/Google Chrome.app' --args --enable-sync"
  3. Go to “File” -> “Save As…”
  4. Enter “Chrome” as the name (you can use another name if you want), set “Where” to “Applications”, and set “File Format:” to “Application”, and click “OK”

    The Save window for the AppleScript editor.

    The Save window for the AppleScript editor.

That’s all there is to it.  Now if you launch the “Chrome” application, it calls the “Google Chrome” app with bookmark synchronization enabled.  If you want, you can change the icon for “Chrome”.  This part is optional, it is purely for aesthetic purposes.  To do this:

  1. Open “Applications” in Finder
  2. Right-click on “Google Chrome” and select “Show Package Contents”
  3. Open the “Contents” folder and then the “Resources” folder
  4. Right-click on the file “app.icns” and select “Copy “App.icns” “
  5. Go back to “Applications”
  6. Right-click on “Chrome” and select Show Package Contents”
  7. Open the “Contents” folder and then the “Resources” folder
  8. Drag the file “applet.icns” to the trash
  9. Right-click inside the Finder window and select “Paste Item”
  10. Right-click on the “app.icns” file that appeared in the window and select “Get Info”
  11. In the “Name and Extension” box, change “app.icns” to “applet.icns” and then close the window.

    The Info window showing the renamed icon.

    The Info window showing the renamed icon.

Enabling sync on Linux

Fortunately, Linux makes it a little easier to enable sync when you launch.  You once again use the same –enable-sync option, but implementing it is a bit simpler.  If you normally launch your applications from the command line, it’s just as simple as:

/opt/google/chrome/chrome --enable-sync

assuming that Chrome has been installed into /opt/google/chrome (That’s where it will end up if you use the .deb file available from the Chrome website.  .deb files are only installable on Debian-based systems (e.g. Debian, Ubuntu, Maemo.  If you’re using an RPM-based system like Fedora or CentOS, see my notes below.)

If, like most people, you launch your applications from your desktop environment, you just need to edit the launcher to include the –enable-sync option.  Since there are a wide variety of desktop environments, I won’t reproduce steps for all of them here.  If you’re not sure how to do it in your desktop environment, try a Google search or check the LinuxForums website.  As a sample, here’s the steps for KDE 4 (since I’m using Fedora, I had to manually create the menu entry in the first place):

  1. Right-click the Kickoff Application Launcher and select Menu Editor
  2. Find the category you want to put it in (I suggest “Internet”) and click on it
  3. Click the “New Item” button at the top
  4. Enter “Chrome” and click “OK”
  5. Set the “Description to  “Google Chrome web browser”, and the Command to “/opt/google/chrome/chrome –enable-sync” (assuming that’s the place you installed Google Chrome to)
  6. Click on the icon it has selected (probably a question mark)
  7. Select “Other icons:” as the “Icon Source” and type “/opt/google/chrome” into the “Search” box and hit enter
  8. Click the “Save” button in the upper-left corner of the window

Installing Chrome on RPM-based systems

I learned the hard way that the .deb file can nearly break your system if you’re not careful — at least as of the build I grabbed to do this blog post.  What you need to do to unpack the chrome browser is to run the following command:

ar p google-chrome-unstable_current_i386.deb data.tar.lzma | lzma -dc | tar vx

Since this puts everything in the right destination (e.g. /opt/google/chrome and a few files in /usr and /etc), I ran it as root from the / directory.  As it turns out, this was a really bad idea.  Although all the files got put in the right place, I suddenly found my account unable to do anything.  I couldn’t even log in.  After a few very frustrating minutes, I figured out that the permissions on / got changed to 700.  Once I corrected the permissions on /, everything was happy again.  So if you insist on running the above command from / as root, be prepared to chmod 700 / in order to make your system usable again (the root user was still able to function normally, of course).  A safer, if more tedious, solution would be to unpack it somewhere safe, like /tmp and then move the files to their correct places.

Once you’ve got it installed, you need to create a few symbolic links so that Chrome knows where to find libraries.  The commands below do the trick:

ln -s /usr/lib/libnss3.so /usr/lib/libnss3.so.1d
ln -s /usr/lib/libnssutil3.so /usr/lib/libnssutil3.so.1d
ln -s /usr/lib/libsmime3.so /usr/lib/libsmime3.so.1d
ln -s /usr/lib/libssl3.so /usr/lib/libssl3.so.1d
ln -s /usr/lib/libplds4.so /usr/lib/libplds4.so.0d
ln -s /usr/lib/libplc4.so /usr/lib/libplc4.so.0d
ln -s /usr/lib/libnspr4.so /usr/lib/libnspr4.so.0d

One thought on “Using bookmark synchronization on Google Chrome for Linux and Mac

Leave a Reply

Your email address will not be published. Required fields are marked *