/* * restore-quicksaver-tab-groups.js * Copyright (C) 2017 Teerapap Changwichukarn * * Distributed under terms of the MIT license. */ // This script restores tab groups from Firefox session backup. // For my case, OSX, the session backup is at ~/Library/Application\ Support/Firefox/Profiles/{random string}.default/sessionstore-backups/previous.js // Actually this backup file is a JSON file so the script just parses it and pretty-print as html file. var fs = require('fs'); var obj = JSON.parse(fs.readFileSync('previous.js', 'utf8')); var tabgroups = JSON.parse(obj["windows"][0]["extData"]["tabview-group"]); var tabs = obj["windows"][0]["tabs"]; tabgroups["pin"] = {"title": "Pinned tab"}; console.log(""); for (i=0;i" + tabgroups[gid]["title"] + "\n"); console.log("\n"); } console.log("");