Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If Google Chrome and Firefox are both running, is there any way to transfer all browser tabs from Firefox to Google Chrome? I want to write a shell script that will transfer all tabs from Firefox to Google Chrome on Ubuntu.

share|improve this question
A related question:… – Anderson Green Jan 3 '13 at 5:55
If you want to do the reverse of this (transferring the tabs from Google Chrome to Firefox), then the following question may be useful:… – Anderson Green Jan 3 '13 at 5:58
To open the page in a new Chrome tab, you would use the following command: google-chrome – Anderson Green Jan 3 '13 at 6:01

Following the idea given in the comments (getting the links from the sessionrestore.js file in the FF profile dir), here is a Bash script with embedded Python to open the current tabs in Google Chrome:

google-chrome $(cat ~/.mozilla/firefox/*.default/sessionstore.js | python -c """
import sys, json
jsobj = json.loads(
for tab in jsobj['windows'][0]['tabs']:
        print tab['entries'][0]['url'],

Please note that although the script works alright, it isn't verifying anything. But a more robust version of this would check the existence of file sessionrestore.js, verify the result of loading the JSON file and its contents, and so on.

share|improve this answer
This looks interesting, thanks. What do you mean when you say that the script isn't verifying anything? – Anderson Green Jan 8 '13 at 0:24
I mean it does not verifies if the file sessionrestore.js exists, before trying to load. A more robust script would first check if the file exists, something like [ -f PATH/TO/sessionrestore.js ] || { echo "sessionrestore not found!"; exit 1; }, things like this. – elias Jan 8 '13 at 0:30

Install the Xmarks extension on both Firefox and Chrome. Besides synchronizing your bookmarks across the browsers you'll be able to use the function "Open remote tabs" which does precisely what you want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.