Skip to content

Instantly share code, notes, and snippets.

@PeterMortensen
Forked from clochix/extractsession.js
Created January 31, 2017 20:23
Show Gist options
  • Save PeterMortensen/9a9213feaeed6b95a540b35376055c14 to your computer and use it in GitHub Desktop.
Save PeterMortensen/9a9213feaeed6b95a540b35376055c14 to your computer and use it in GitHub Desktop.
Extract URLs of every tab from the file `sessionstore.js` in a Firefox profile
#!/usr/bin/env nodejs
//jshint node: true
require('fs').readFile('sessionstore.js', {encoding: 'utf8'}, function (err, data) {
"use strict";
var session;
if (err) {
throw err;
}
session = JSON.parse(data);
session.windows.forEach(function (window) {
window.tabs.forEach(function (tab) {
console.log(tab.entries.pop().url);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment