![Firefox logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-13-8dda6f.png)
How can I record the tabs available in the "Restore Session"
I have a new macbook and I still have problems with Firefox running too slow. I use FF for research for my work all the time a have many windows open and many tabs open in them. Eventually it slows down too much with all those windows open. How can I save the restore session list of tabs, without having to bookmark them all. Currently all I can do is crash FF and the restore session tab has within it all the tabs from the previous session. So I never close that restore session tab and when FF slows down again I crash it again and then keep that new restore session tab open again. That way by digging down into my restore session I can go back in my history and only see the tabs I left open which are useful for me. The history is way too detailed for me - each tab may well have had ten different pages I opened before I open a new tab. The number of Tabs I want to be able to search is far too many to bookmark. Thankfully FF has this function of Restore Session - no other browsers I have found have this. If you could build in a way to create a restore point which contains what is findable in the "Restore Session" screen that would make my use of this browser much much easier, less sttressful and more secure. It would be good by creating a restore point it was stored in a list showing my history of restore points.
所有回覆 (1)
Try this code in the Browser Console to create a list of currently open tabs.
You can open the Browser Console ("3-bar" menu button or Tools -> Web Developer). Set devtools.chrome.enabled to true on the about:config page to enable the command line.
Paste the JavaScript code in the command line. Press the Enter key to evaluate the JavaScript code.
(function(){ var {classes:Cc,interfaces:Ci} = Components; var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); var nb = wm.getEnumerator("navigator:browser"); var i,j=0,l,t=[],H,L; while(nb.hasMoreElements()){ var gB = nb.getNext().gBrowser; var mP = gB.mPanelContainer.childNodes; var mT = gB.mTabContainer.childNodes; l = mP.length; t.push(((j>0)?'<hr>':'')+'<b>Window '+(++j)+'</b><br>'); for(var i=0;i<l;i++){ H=gB.getBrowserAtIndex(i).contentDocument.location.href; L=mT[i].getAttribute('label'); t.push('<a href="'+H+'">'+H+' «'+L+'»'+'</a>'); }} var dataTxt = '<html><head>\n</head>\n<body>\n</body></html>'; var headTxt = '<title>Windows ('+j+')</title>\n'+'<style>body,hr{counter-reset:links}\na:before{content:"[" counter(links) "] ";counter-increment:links;color:#000;font-weight:bold}\n</style>\n'; var bodyTxt = t.join('<br>\n'); var dataURI = 'data:text/html;charset=utf-8,'+dataTxt; var gB = wm.getMostRecentWindow("navigator:browser").gBrowser; var tab = gB.addTab(dataURI); gB.selectedTab = tab; setTimeout(function(){ var d = gB.selectedBrowser.contentDocument; d.querySelector('head').innerHTML = headTxt; d.body.innerHTML = bodyTxt;},500); })()