Skip to content

Instantly share code, notes, and snippets.

@p0w3rsh3ll
Created December 19, 2016 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p0w3rsh3ll/1ce19dea81f760466b84c11e435dff6d to your computer and use it in GitHub Desktop.
Save p0w3rsh3ll/1ce19dea81f760466b84c11e435dff6d to your computer and use it in GitHub Desktop.
try {
Add-Type -AssemblyName System.Web.Extensions
$javaScriptSerializer = New-Object System.Web.Script.Serialization.JavaScriptSerializer
$javaScriptSerializer.MaxJsonLength = [System.Int32]::MaxValue
$javaScriptSerializer.RecursionLimit = 99
(
(
$javaScriptSerializer.DeserializeObject(
(Get-Content -Encoding UTF8 -Raw -Path "$($env:APPDATA)\Mozilla\Firefox\Profiles\*\sessionstore-backups\recovery.js" -ErrorAction Stop).Trim('()')
)['windows']
) | Select -First 1
)['tabs'] |
Where { -not($_.hidden) } |
ForEach-Object {
$e = @($_.entries)[-1]
[pscustomobject]@{
url = ($e)['url']
title= ($e)['title']
}
}
} catch {
Write-Warning -Message "Failed because $($_.Exception.Message)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment