Created
November 18, 2013 13:07
-
-
Save clochix/7527463 to your computer and use it in GitHub Desktop.
extract urls of every tabs from the file `sessionstore.js` in a Firefox profile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); | |
}); | |
}); | |
}); |
Well, I have Firefox, I have this scpript file, ... and what next?
I have tried it in the Scratchpad and the result is:
/*
Exception: SyntaxError: illegal character
@ Scratchpad/1:1
*/
What to do?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
J'ai forké pour générer du HTML : https://gist.github.com/nhoizey/7527818