SHARE
TWEET

Untitled

a guest Mar 12th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     // Tracks the number of Firefox tabs.  For curiosity purposes.
  3.  
  4.     do
  5.     {
  6.         // I run Firefox Portable, so you'll have to find 'recovery.js' on your system and replace accordingly.
  7.         $data = @json_decode(@file_get_contents("/FirefoxPortable/Data/profile/sessionstore-backups/recovery.js"), true);
  8.  
  9.         if ($data === false)  sleep(1);
  10.     } while ($data === false);
  11.  
  12.     $numwindows = count($data["windows"]);
  13.     $numtabs = 0;
  14.     for ($x = 0; $x < count($data["windows"]); $x++)
  15.     {
  16.         $numtabs += count($data["windows"][$x]["tabs"]);
  17.     }
  18.  
  19.     // In case you want to track it across time (e.g. run daily).
  20.     $fp = fopen("/path/to/youruser/tab_tracker.csv", "ab");
  21.     fputcsv($fp, array(date("Y-m-d"), $numtabs, $numwindows));
  22.     fclose($fp);
  23. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top