Created
July 28, 2011 11:15
-
-
Save mschmitt/1111395 to your computer and use it in GitHub Desktop.
Playing with the Firefox session file...
This file contains 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/perl -w | |
use strict; | |
use diagnostics; | |
use JSON; | |
use Data::Dumper; | |
my $sessionstore = '/home/martin/.mozilla/firefox/12345678.default/sessionstore.js'; | |
my $json_raw; | |
open my $fh_in, "<$sessionstore" or die "Can't open $sessionstore: $!\n"; | |
while (<$fh_in>){ | |
$json_raw .= $_; | |
} | |
my $json = JSON->new->utf8; | |
my $json_cooked = $json->decode($json_raw); | |
my @windows = @{$json_cooked->{'windows'}}; | |
foreach my $window (@windows){ | |
my $tabs = $window->{'tabs'}; | |
print Dumper($tabs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment