Talk about add-ons and extension development.
old zeniko
Posts: 0Joined: December 31st, 1969, 5:00 pm
Posted March 28th, 2006, 10:20 am
Peng wrote:Because it usually counts up from zero. Except now it's also counting up from 4158661582. The first entry in the first tab is 0, then the next one is 4158661582, and it goes up to 4158661619.
Newly added tabs start somewhere around 0, restored tabs get arbitrary high IDs (so that they don't collide with the newly added ones). Peng wrote:If I set extensions.crashrecovery.postdata to 0, does it still save stuff in text boxes like this?
Sure. The POSTDATA pref just controls what is sent from the browser to the server. Form data will always be saved (dependent on the .privacy_level pref). Peng wrote:Firefox uses that dialog, but since Crash Recovery is for restoring from crashes and loads lots of tabs at the same time, it should use an error page instead of the same dialog...
Of course I'd use something like an error page. As already mentioned, the problem is that this isn't possible from pure JS. Peng wrote:If Cache Fixer is still built in, well, it doesn't work for me on Linux. The cache still gets completely wiped out.
Cache Fixer is still included. It is however not as reliable as I'd like it to be (just better than nothing).
Peng

Posts: 778Joined: November 9th, 2004, 2:31 pmLocation: Central Florida
Posted March 28th, 2006, 1:54 pm
zeniko wrote:Newly added tabs start somewhere around 0, restored tabs get arbitrary high IDs (so that they don't collide with the newly added ones).
Oh, okay.  Now what would happen if I actually had opened a few billion tabs?  zeniko wrote:Cache Fixer is still included. It is however not as reliable as I'd like it to be (just better than nothing).
Well, I don't think it's ever worked for me.
XerBlade

Posts: 865Joined: October 4th, 2005, 10:45 pmLocation: Nashville, TN, US
Posted March 28th, 2006, 8:28 pm
Peng wrote:Now what would happen if I actually had opened a few billion tabs? 
Your computer wanted me to tell it thinks it's too young to die.
Peng

Posts: 778Joined: November 9th, 2004, 2:31 pmLocation: Central Florida
Posted March 28th, 2006, 9:38 pm
XerBlade wrote:Your computer wanted me to tell it thinks it's too young to die.
As soon as I get off my ass and finish building the other one, it will.
bookworm_2005

Posts: 19Joined: March 29th, 2006, 9:51 pm
Posted March 29th, 2006, 10:06 pm
First, I want to say how much I love Crash Recovery. I was using Tab Saver as my session manager and running Crash Recovery for the crash recovery feature. When I learned about the hidden preference that allows you to use CR to restore a session, I decided to remove Tab Saver and use CR. I really love the way it restores my sessions. It remembers everything, even the font size, and it does it all automatically. The only feature I miss is the ability to recover a closed tab. I know that your other extension, Session Manager, has this feature, but I didn't like the way it handled it when I tried it. I much prefer the way <a href="http://forums.mozillazine.org/viewtopic.php?t=72992">undoclosetab</a> handles this, as I rarely need to recover more than one tab, and having the command on the tab bar context menu is really convenient. Do you think you might add this feature to CR? It would be in keeping with the idea of simple crash recovery, and would allow for a simple and smooth integration into Firefox by putting the option where people expect to see it (on the Tab bar context menu). People who needed more complex tab restore options could of course use session manager instead.
Again, thank you for making such a great extension.
Peng

Posts: 778Joined: November 9th, 2004, 2:31 pmLocation: Central Florida
Posted March 29th, 2006, 10:14 pm
Tab Mix Plus has its own restoring-closed-tabs feature, similar to Session Manager, and it can add 'Undo Close Tab' to the tab bar context menu, along with doing lots of other cool stuff.
(BTW: I use zeniko's Session Manager extension, not TMP's session manager. There aren't any conflicts. I found TMP's to be extremely unreliable when restoring after crashes (it would always lose at lease one tab; the time it didn't, shortly after, it lost a tab on a non-crashing restart), and zeniko's extension saves form data and cookies, too.)
bookworm_2005

Posts: 19Joined: March 29th, 2006, 9:51 pm
Posted March 29th, 2006, 10:30 pm
Yes, I've tried TMP, but I really don't need any of it's tab management features and I also found it's session saver unreliable. That's why I am looking for a simple session restore/crash recovery & tab rescue extension. Using Crash Recovery with Undoclosetab does the job beautifully, and it would be nice if the two were merged, since the features they provide are so closely related.
Bookworm
Peng

Posts: 778Joined: November 9th, 2004, 2:31 pmLocation: Central Florida
Posted March 29th, 2006, 10:50 pm
Oooh. I bet zeniko's userChrome.js extension could do this, if you use Session Manager. I don't know how, but I bet it could.
Of course, that would be another extension, and switching to Session Manager. 
old zeniko
Posts: 0Joined: December 31st, 1969, 5:00 pm
Posted April 2nd, 2006, 5:54 am
bookworm_2005 wrote:The only feature I miss is the ability to recover a closed tab. [...] Do you think you might add this feature to CR? It would be in keeping with the idea of simple crash recovery, and would allow for a simple and smooth integration into Firefox by putting the option where people expect to see it (on the Tab bar context menu).
This feature is not within the reach of this extension. Crash Recovery is about recovering from crashes, not recovering regularly closed tabs or windows. If you really want this feature without the whole rest of Session Manager's features, you could try adding <a href="data:text/javascript,var%20UndoCloseTab%20%3D%20%7B%0A%09MAX_REOPENABLE_TABS%3A%2010%2C%0A%0A%09mCrashRecoveryService%3A%20Components.classes%5B%22%40zeniko%2Fcrashrecoveryservice%3B1%22%5D.getService(Components.interfaces.nsICrashRecoveryService)%2C%0A%09mOneTabRE%3A%20%2F%5Cn%5C%5BWindow(%5Cd%2B%5C.Tab%5Cd%2B)%5C%5D%5Cn%5B%5Cs%5CS%5D*%3F(%3F%3D%5Cn%5C%5BWindow(%3F!%5C1)%7C%24)%2Fg%2C%0A%09mClosedTabs%3A%20%5B%5D%2C%0A%0A%09init%3A%20function()%0A%09%7B%0A%09%09getBrowser().addEventListener(%22UCTabClosing%22%2C%20function(aEvent)%20%7B%20UndoCloseTab.onTabClosing(aEvent.originalTarget)%3B%20%7D%2C%20false)%3B%0A%09%09%0A%09%09eval(%22gBrowser.removeTab%20%3D%20%22%20%2B%20gBrowser.removeTab.toString().replace(%2F%5C%7B%2F%2C%20'%24%26%20var%20%24%24UC_event%20%3D%20document.createEvent(%22Events%22)%3B%20%24%24UC_event.initEvent(%22UCTabClosing%22%2C%20true%2C%20false)%3B%20((aTab.localName%20!%3D%20%22tab%22)%3Fthis.mCurrentTab%3AaTab).dispatchEvent(%24%24UC_event)%3B'))%3B%0A%09%09%0A%09%09this.mMenuitem%20%3D%20document.createElement(%22menuitem%22)%3B%0A%09%09%0A%09%09this.mMenuitem.setAttribute(%22label%22%2C%20%22Undo%20Close%20Tab%22)%3B%0A%09%09this.mMenuitem.setAttribute(%22oncommand%22%2C%20%22UndoCloseTab.undoCloseTab()%3B%22)%3B%0A%09%09this.mMenuitem.setAttribute(%22accesskey%22%2C%20%22U%22)%3B%0A%09%09%0A%09%09this.setDisabled(true)%3B%0A%09%09gBrowser.mStrip.firstChild.nextSibling.appendChild(this.mMenuitem)%3B%0A%09%09%0A%09%09if%20(!gBrowser.undoRemoveTab)%20%2F%2F%20tweak%20for%20Tab%20Clicking%20Options%0A%09%09%7B%0A%09%09%09gBrowser.undoRemoveTab%20%3D%20function()%20%7B%20UndoCloseTab.undoCloseTab()%3B%20%7D%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09onTabClosing%3A%20function(aTab)%0A%09%7B%0A%09%09var%20browser%20%3D%20gBrowser.getBrowserForTab(aTab)%3B%0A%09%09if%20(browser.sessionHistory.count%20%3C%202%20%26%26%20browser.currentURI.spec%20%3D%3D%20%22about%3Ablank%22)%0A%09%09%7B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09%0A%09%09var%20state%20%3D%20this.mCrashRecoveryService.getWindowState(window)%3B%0A%09%09var%20position%20%3D%20aTab._tPos%20%2B%201%3B%0A%09%09%0A%09%09state%20%3D%20state.substr(state.indexOf(%22%5Cn%5BWindow1.Tab%22%20%2B%20position%20%2B%20%22%5D%22)).match(this.mOneTabRE)%5B0%5D.replace(%2F%5E(%5C%5BWindow1%5C.Tab)%5Cd%2B%2Fgm%2C%20%22%2411%22)%3B%0A%09%09%0A%09%09this.mClosedTabs.unshift(%7B%20name%3A%20aTab.label%2C%20pos%3A%20position%2C%20state%3A%20state%20%7D)%3B%0A%09%09this.mClosedTabs.splice(this.MAX_REOPENABLE_TABS)%3B%0A%09%09%0A%09%09this.setDisabled(false)%3B%0A%09%7D%2C%0A%0A%09undoCloseTab%3A%20function(aIx)%0A%09%7B%0A%09%09if%20(this.mClosedTabs%5BaIx%20%7C%7C%200%5D)%0A%09%09%7B%0A%09%09%09var%20tabData%20%3D%20this.mClosedTabs.splice(aIx%20%7C%7C%200%2C%201)%5B0%5D%3B%0A%09%09%09this.mCrashRecoveryService.restoreWindow(window%2C%20tabData.state%2C%20false)%3B%0A%09%09%09%0A%09%09%09var%20newTab%20%3D%20document.getAnonymousElementByAttribute(gBrowser%2C%20%22linkedpanel%22%2C%20gBrowser.mPanelContainer.lastChild.id)%3B%0A%09%09%09if%20(tabData.pos%20%26%26%20tabData.pos%20%3C%20gBrowser.mTabs.length)%0A%09%09%09%7B%0A%09%09%09%09gBrowser.moveTabTo(newTab%2C%20tabData.pos%20-%201)%3B%0A%09%09%09%7D%0A%09%09%09gBrowser.selectedTab%20%3D%20newTab%3B%0A%09%09%09%0A%09%09%09this.setDisabled(this.mClosedTabs.length%20%3D%3D%200)%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09setDisabled%3A%20function(aValue)%0A%09%7B%0A%09%09if%20(aValue)%0A%09%09%7B%0A%09%09%09this.mMenuitem.setAttribute(%22disabled%22%2C%20%22true%22)%3B%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09this.mMenuitem.removeAttribute(%22disabled%22)%3B%0A%09%09%7D%0A%09%7D%0A%7D%3B%0A%0AUndoCloseTab.init()%3B%0A">these lines</a> to your userChrome.js. OTOH, using the undoclosetab extension is probably the easier solution...
bookworm_2005

Posts: 19Joined: March 29th, 2006, 9:51 pm
Posted April 2nd, 2006, 2:43 pm
zeniko wrote: This feature is not within the reach of this extension. Crash Recovery is about recovering from crashes, not recovering regularly closed tabs or windows. If you really want this feature without the whole rest of Session Manager's features, you could try adding <a href="data:text/javascript,var%20UndoCloseTab%20%3D%20%7B%0A%09MAX_REOPENABLE_TABS%3A%2010%2C%0A%0A%09mCrashRecoveryService%3A%20Components.classes%5B%22%40zeniko%2Fcrashrecoveryservice%3B1%22%5D.getService(Components.interfaces.nsICrashRecoveryService)%2C%0A%09mOneTabRE%3A%20%2F%5Cn%5C%5BWindow(%5Cd%2B%5C.Tab%5Cd%2B)%5C%5D%5Cn%5B%5Cs%5CS%5D*%3F(%3F%3D%5Cn%5C%5BWindow(%3F!%5C1)%7C%24)%2Fg%2C%0A%09mClosedTabs%3A%20%5B%5D%2C%0A%0A%09init%3A%20function()%0A%09%7B%0A%09%09getBrowser().addEventListener(%22UCTabClosing%22%2C%20function(aEvent)%20%7B%20UndoCloseTab.onTabClosing(aEvent.originalTarget)%3B%20%7D%2C%20false)%3B%0A%09%09%0A%09%09eval(%22gBrowser.removeTab%20%3D%20%22%20%2B%20gBrowser.removeTab.toString().replace(%2F%5C%7B%2F%2C%20'%24%26%20var%20%24%24UC_event%20%3D%20document.createEvent(%22Events%22)%3B%20%24%24UC_event.initEvent(%22UCTabClosing%22%2C%20true%2C%20false)%3B%20((aTab.localName%20!%3D%20%22tab%22)%3Fthis.mCurrentTab%3AaTab).dispatchEvent(%24%24UC_event)%3B'))%3B%0A%09%09%0A%09%09this.mMenuitem%20%3D%20document.createElement(%22menuitem%22)%3B%0A%09%09%0A%09%09this.mMenuitem.setAttribute(%22label%22%2C%20%22Undo%20Close%20Tab%22)%3B%0A%09%09this.mMenuitem.setAttribute(%22oncommand%22%2C%20%22UndoCloseTab.undoCloseTab()%3B%22)%3B%0A%09%09this.mMenuitem.setAttribute(%22accesskey%22%2C%20%22U%22)%3B%0A%09%09%0A%09%09this.setDisabled(true)%3B%0A%09%09gBrowser.mStrip.firstChild.nextSibling.appendChild(this.mMenuitem)%3B%0A%09%09%0A%09%09if%20(!gBrowser.undoRemoveTab)%20%2F%2F%20tweak%20for%20Tab%20Clicking%20Options%0A%09%09%7B%0A%09%09%09gBrowser.undoRemoveTab%20%3D%20function()%20%7B%20UndoCloseTab.undoCloseTab()%3B%20%7D%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09onTabClosing%3A%20function(aTab)%0A%09%7B%0A%09%09var%20browser%20%3D%20gBrowser.getBrowserForTab(aTab)%3B%0A%09%09if%20(browser.sessionHistory.count%20%3C%202%20%26%26%20browser.currentURI.spec%20%3D%3D%20%22about%3Ablank%22)%0A%09%09%7B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%09%0A%09%09var%20state%20%3D%20this.mCrashRecoveryService.getWindowState(window)%3B%0A%09%09var%20position%20%3D%20aTab._tPos%20%2B%201%3B%0A%09%09%0A%09%09state%20%3D%20state.substr(state.indexOf(%22%5Cn%5BWindow1.Tab%22%20%2B%20position%20%2B%20%22%5D%22)).match(this.mOneTabRE)%5B0%5D.replace(%2F%5E(%5C%5BWindow1%5C.Tab)%5Cd%2B%2Fgm%2C%20%22%2411%22)%3B%0A%09%09%0A%09%09this.mClosedTabs.unshift(%7B%20name%3A%20aTab.label%2C%20pos%3A%20position%2C%20state%3A%20state%20%7D)%3B%0A%09%09this.mClosedTabs.splice(this.MAX_REOPENABLE_TABS)%3B%0A%09%09%0A%09%09this.setDisabled(false)%3B%0A%09%7D%2C%0A%0A%09undoCloseTab%3A%20function(aIx)%0A%09%7B%0A%09%09if%20(this.mClosedTabs%5BaIx%20%7C%7C%200%5D)%0A%09%09%7B%0A%09%09%09var%20tabData%20%3D%20this.mClosedTabs.splice(aIx%20%7C%7C%200%2C%201)%5B0%5D%3B%0A%09%09%09this.mCrashRecoveryService.restoreWindow(window%2C%20tabData.state%2C%20false)%3B%0A%09%09%09%0A%09%09%09var%20newTab%20%3D%20document.getAnonymousElementByAttribute(gBrowser%2C%20%22linkedpanel%22%2C%20gBrowser.mPanelContainer.lastChild.id)%3B%0A%09%09%09if%20(tabData.pos%20%26%26%20tabData.pos%20%3C%20gBrowser.mTabs.length)%0A%09%09%09%7B%0A%09%09%09%09gBrowser.moveTabTo(newTab%2C%20tabData.pos%20-%201)%3B%0A%09%09%09%7D%0A%09%09%09gBrowser.selectedTab%20%3D%20newTab%3B%0A%09%09%09%0A%09%09%09this.setDisabled(this.mClosedTabs.length%20%3D%3D%200)%3B%0A%09%09%7D%0A%09%7D%2C%0A%0A%09setDisabled%3A%20function(aValue)%0A%09%7B%0A%09%09if%20(aValue)%0A%09%09%7B%0A%09%09%09this.mMenuitem.setAttribute(%22disabled%22%2C%20%22true%22)%3B%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09this.mMenuitem.removeAttribute(%22disabled%22)%3B%0A%09%09%7D%0A%09%7D%0A%7D%3B%0A%0AUndoCloseTab.init()%3B%0A">theselines</a> to your userChrome.js. OTOH, using the undoclosetab extension is probably the easier solution...
You are probably right, I'll just stick with undoclosetab for now. Thanks. 
cc_man
Posts: 1Joined: April 13th, 2006, 1:32 pm
Posted April 13th, 2006, 1:37 pm
I couldn't find any info. Is there any licensing to this crash recovery extension beyond MPL?
old zeniko
Posts: 0Joined: December 31st, 1969, 5:00 pm
Posted April 13th, 2006, 2:06 pm
The <a href="jar:http://www.haslo.ch/zeniko/software/crashrecovery.xpi!/license.txt">license</a> is shipped with the extension. It's the usual GPL/ LGPL/ MPL tri-license which applies to most of Mozilla code. Why do you ask?
Peng

Posts: 778Joined: November 9th, 2004, 2:31 pmLocation: Central Florida
Posted April 17th, 2006, 3:57 pm
zeniko wrote:It's the usual GPL/ LGPL/ MPL tri-license which applies to most of Mozilla code.
All of the Mozilla code now. The latest code, at least. 
shoofy
Posts: 385Joined: November 13th, 2004, 4:56 pm
Posted May 7th, 2006, 10:35 pm
Since I installed 0.6.8, whenever I restart Firefox using the restart button from Mr. Tech's Local Install extension Crash Recovery restores my session. All my hidden settigns fro Crash Recovery are at their defaults. I can't tell if this comes from Crash Recovery or MTLI, but I can't find a way to turn it off. When I close and reopen Firefox the normal way my session is not restored.
old zeniko
Posts: 0Joined: December 31st, 1969, 5:00 pm
Posted May 7th, 2006, 10:44 pm
That's MTLI taking advantage of Crash Recovery. If you don't like it, just set the pref local_install.enableSessionManagerResume to false (although I can't imagine why you wouldn't want it  ).
Return to Extension Development
Who is online
Users browsing this forum: No registered users and 1 guest
|