extract all urls from firefox sessionstore

sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txt
This will extract all of the urls from a firefox session (including urls in a tab's history). The sessionstore.js file is in ~/.mozilla/firefox/{firefox profile}

2
By: birnam
2009-06-14 15:08:31

3 Alternatives + Submit Alt

What Others Think

Or, from anywhere in user's workspace: sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" "$(find $HOME -name "sessionstore.js")" | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d"
plasticdoc · 526 weeks and 4 days ago
Good update plasticdoc -- but be aware that this will pull urls from every sessionstore you have - so if you run multiple profiles of firefox like I do, this will return urls from all of them. This might be what you want, maybe not.
birnam · 526 weeks and 4 days ago
Starting from some version of Firefox (I have 63.0.1), now it stores session data in a user profile folder as usual, but using a json compressed format, with extension .jsonlz4
brunobiondo · 32 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: