Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Tracks the number of Firefox tabs. For curiosity purposes.
- do
- {
- // I run Firefox Portable, so you'll have to find 'recovery.js' on your system and replace accordingly.
- $data = @json_decode(@file_get_contents("/FirefoxPortable/Data/profile/sessionstore-backups/recovery.js"), true);
- if ($data === false) sleep(1);
- } while ($data === false);
- $numwindows = count($data["windows"]);
- $numtabs = 0;
- for ($x = 0; $x < count($data["windows"]); $x++)
- {
- $numtabs += count($data["windows"][$x]["tabs"]);
- }
- // In case you want to track it across time (e.g. run daily).
- $fp = fopen("/path/to/youruser/tab_tracker.csv", "ab");
- fputcsv($fp, array(date("Y-m-d"), $numtabs, $numwindows));
- fclose($fp);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement