Saving Chrome Tabs to Dropbox

tl;dr: Save My Tabs is a Chrome extension to save the list of open tabs to Dropbox.

I’ve a weird browser usage pattern due to hardware choices. On two of my devices (work laptop, iPhone), I use Firefox. My personal laptop is a Pixelbook. While it is possible to use Firefox on ChromeOS within Crostini, the experience is pretty abysmal compared to using Chrome. This kept leading to an annoying situation where I couldn’t access tabs open in Chrome on my other devices. It is possible to go the other way, since when I’m on the Pixelbook, I usually have my phone handy and can look up tabs there.

First I thought I had to pick between two different options:

  1. Find some way to access the Mozilla sync service from Chrome.
  2. Find some way to access the Google sync service from Firefox.

Each of which involves writing an extension for one of these browsers.

Accessing Firefox Sync from Chrome

I first considered this, since I already have Mozilla sync set up, whereas I don’t have Chrome sync set up. In addition, Mozilla already has client code in JavaScript to access sync services, so I could leverage that. Finally, I’d also be able to pull in tabs from other devices instead of looking at my phone and typing URLs in. After significant digging, I found Mozilla does not support third-party access to their sync service :( I had to give up on that very promising option.

Accessing Chrome Sync from Firefox

This seems possible, but apart from the friction of setting up Chrome sync, I’d have to implement a bunch of protocol buffer stuff in JavaScript. That didn’t seem like fun. Plus Google apparently doesn’t like this.

Always bet on text?

For now, I’ve gone with the simplest solution. Save My Tabs is a simple Chrome extension that connects to Dropbox via OAuth and saves the list of open tabs in Chrome to a text file. This file is updated as tabs are opened and closed. On other devices I can open this file and click links. The source code is on Github. This is my first Chrome extension, and I don’t intend to spend any time making the code pretty, so it is what it is. It doesn’t have a concept of devices, so if you use it on multiple browsers, your file will just be overwritten.

This still doesn’t solve the problem of getting tabs from Firefox into Chrome… but one step at a time.

Addendum

The pain of publishing

Turns out getting people to allow you to publish untrusted code on their platform is a major PITA (who knew right?)! I’ve had to make a (rudimentary) icon, create a screen-cast and been rejected once from the Chrome Web Store for appearing spammy. I’m giving it one more shot, otherwise just use the zip file. This is now published. Interested parties can read the few lines of code and verify that the Dropbox SDK matches.

Chrome extensions need a well-known URI to use OAuth, which makes sense. This means you need an extension ID that does not change. It is not obvious from the Chrome documentation that this ID is inferred from a private key, and you need to generate such a key. In addition, the “key” to put in the manifest is the public key, and not the extension ID. Thanks StackOverflow. This OAuth stuff is still a little flaky. I’m hoping once the extension is published, it will become more reliable. Meanwhile, hit “Sign in to Dropbox” multiple times on the Options page.

xbrowsersync

I ran into this while editing this post. It seems kinda like what I’m looking for, but I’ll continue to wait for option 1 to become viable.