title: How can I get list of open tabs in Firefox via a command-line application?
body: <p>I have a lot of tabs open in Firefox. After I close Firefox and then run it again, the tabs are there. That's all right.</p>
  
  <p>However, from time to time, Firefox crashes and my tabs are lost. How do I get the open tabs and backup the list to some file?</p>
  
  <p>(With tabs in a file, I can also use <a href="http://en.wikipedia.org/wiki/Git_%28software%29" rel="noreferrer">Git</a>, <a href="http://en.wikipedia.org/wiki/Apache_Subversion" rel="noreferrer">SVN</a>, or whatever to store them and optionally find some link 'that I saw in my browser but can't remember what it was'.)</p>
  
  <p><strong>What I got so far:</strong></p>
  
  <p>I'm able to get some <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator" rel="noreferrer">URLs</a>, but that's doesn't seem to be exactly what I see in Firefox:</p>
  
  <pre><code>$c = ((gc c:\Users\..\AppData\Roaming\Mozilla\Firefox\Profiles\xfvj8vd5.default\sessionstore.js ) -join '')
  $sess = [Jayrock.Json.Conversion.JsonConvert]::Import( $c.trim('()') )
  $sess.windows[0].tabs |
    % { $_.entries } |
    % { $_.url } |
    Select-Object -Unique
  </code></pre>
  
  <p><em>Please, don't tell me "use this addon or that addon". I really would like do it as I described.</em></p>