[Ext] Crash Recovery 0.6.10 [discontinued]

Talk about add-ons and extension development.
Locked
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

[Ext] Crash Recovery 0.6.10 [discontinued]

Post by old zeniko »

Crash Recovery has been discontinued (it's included in Firefox 2.0).
------------------------------------------------------------------------------------------
<a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">Crash Recovery</a> recovers all windows/tabs after a crash.

Crash Recovery 0.3.x/0.4.x was a heavily modified version of SessionSaver which was specialized in crash recovering. It was discontinued after the development of SessionSaver was finally resumed in early 2005. Since then, SessionSaver has been growing and growing. Now Crash Recovery is back, lean and mean, offering you just basic crash protection and no unnecessary clutter...

Crash Recovery is active from the moment of its installation - no configuration is needed. Should your browser ever crash, it will offer you to restore all tabs from before that crash, including history and text data. If you want to use it also for session resuming, simply toggle the hidden pref extensions.crashrecovery.resume_session.

If you miss session saving functionality, you could try Session Manager which enhances Crash Recovery with a simple interface for saving and restoring browsing states.

Download
<a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">Crash Recovery 0.6.10</a> (changelog, contributors)
This release works for Firefox 1.5, SeaMonkey 1.0 and Flock 0.5.

More Information
Crash Recovery finally has a homepage of its own: http://sessionmanager.mozdev.org/crashrecovery/. Go there for more information, a screenshot and a detailed changelog.
Last edited by old zeniko on October 24th, 2006, 3:15 pm, edited 61 times in total.
Leland
Posts: 25
Joined: November 18th, 2002, 7:44 am

Post by Leland »

Nice work. I'll check it out. I don't suppose you would be willing to update sessionsaver for 1.0?
Guinness for strength!
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Re: Crash Recovery 0.3 (based on SessionSaver 0.2.1)

Post by AnonEmoose »

zeniko wrote:. However, it should also run on Firefox 0.8 to 1.0PR and most probably on newer Seamonkey builds, as well (anyone willing to try that?).
It works on Moz 1.7.3 & Netscape 7.2 (didn't try 7.1)

1 minor thing is that the user needs to add the line to their user.js or prefs .js (with Mozilla closed) in order to take advantage of the pref

user_pref("crashrecovery.sessionsaver", false);

Otherwise, it works well....
below is an install.js to include in the xpi package to make it install on Mozilla/Netscape

// XpiInstaller
// By Pike (Heavily inspired by code from Henrik Gemal and Stephen Clavering)

var XpiInstaller = {

// --- Editable items begin ---
extFullName: 'Crash Recovery', // The name displayed to the user (don't include the version)
extShortName: 'crashrecovery', // The leafname of the JAR file (without the .jar part)
extVersion: '0.3',
extAuthor: 'zeniko',
extLocaleNames: null, // e.g. ['en-US', 'en-GB'] Set to null for nothing ['en-US']
extSkinNames: null, // e.g. ['classic', 'modern'] Set to null for nothing ['classic']
extPostInstallMessage: null, // Set to null for no post-install message
// --- Editable items end ---

profileInstall: true,
silentInstall: false,

install: function()
{
var jarName = this.extShortName + '.jar';
var profileDir = Install.getFolder('Profile', 'chrome');

// Parse HTTP arguments
this.parseArguments();

// Check if extension is already installed in profile
if (File.exists(Install.getFolder(profileDir, jarName)))
{
if (!this.silentInstall)
{
Install.alert('Updating existing Profile install of ' + this.extFullName + ' to version ' + this.extVersion + '.');
}
this.profileInstall = true;
}
else if (!this.silentInstall)
{
// Ask user for install location, profile or browser dir?
this.profileInstall = Install.confirm('Install ' + this.extFullName + ' ' + this.extVersion + ' to your Profile directory (OK) or your Browser directory (Cancel)?');
}

// Init install
var dispName = this.extFullName + ' ' + this.extVersion;
var regName = '/' + this.extAuthor + '/' + this.extShortName;
Install.initInstall(dispName, regName, this.extVersion);

// Find directory to install into
var installPath;
if (this.profileInstall) installPath = profileDir;
else installPath = Install.getFolder('chrome');

// Add JAR file
Install.addFile(null, 'chrome/' + jarName, installPath, null);

// Register chrome
var jarPath = Install.getFolder(installPath, jarName);
var installType = this.profileInstall ? Install.PROFILE_CHROME : Install.DELAYED_CHROME;

// Register content
Install.registerChrome(Install.CONTENT | installType, jarPath, 'content/' + this.extShortName + '/');

// Register locales
for (var locale in this.extLocaleNames)
{
var regPath = 'locale/' + this.extLocaleNames[locale] + '/' + this.extShortName + '/';
Install.registerChrome(Install.LOCALE | installType, jarPath, regPath);
}

// Register skins
for (var skin in this.extSkinNames)
{
var regPath = 'skin/' + this.extSkinNames[skin] + '/' + this.extShortName + '/';
Install.registerChrome(Install.SKIN | installType, jarPath, regPath);
}

// Perform install
var err = Install.performInstall();
if (err == Install.SUCCESS || err == Install.REBOOT_NEEDED)
{
if (!this.silentInstall && this.extPostInstallMessage)
{
Install.alert(this.extPostInstallMessage);
}
}
else
{
this.handleError(err);
return;
}
},

parseArguments: function()
{
// Can't use string handling in install, so use if statement instead
var args = Install.arguments;
if (args == 'p=0')
{
this.profileInstall = false;
this.silentInstall = true;
}
else if (args == 'p=1')
{
this.profileInstall = true;
this.silentInstall = true;
}
},

handleError: function(err)
{
if (!this.silentInstall)
{
Install.alert('Error: Could not install ' + this.extFullName + ' ' + this.extVersion + ' (Error code: ' + err + ')');
}
Install.cancelInstall(err);
}
};

XpiInstaller.install();
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Re: Crash Recovery 0.3 (based on SessionSaver 0.2.1)

Post by old zeniko »

AnonEmoose: Many thanks for the testing and the installer. I modified the summary above accordingly.

AnonEmoose wrote:1 minor thing is that the user needs to add the line to their user.js or prefs .js (with Mozilla closed) in order to take advantage of the pref

user_pref("crashrecovery.sessionsaver", false);


Doesn't Mozilla support about:config? Or are you asking for a dialog for this one option? Anyway, if you want to take advantage of the pref in the above way, you'd have to set it to true.

Leland wrote:I don't suppose you would be willing to update sessionsaver for 1.0?


The updated SessionSaver can be found at the Extensions Mirror (which seems to be down right now).
ajhubble
Posts: 524
Joined: February 3rd, 2004, 2:25 pm

Post by ajhubble »

Hmmm, an extension called "Crash Recovery" could be expanded to other things that go haywire when Firefox crashes. What about fiddling around with the caching code to make it so it doesn't throw out the entire cache on a crash? Why? Because it takes so much longer to recover all those saved tabs (I use SessionSaver) when Firefox needs to recheck all the websites and download everything again.
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Re: Crash Recovery 0.3 (based on SessionSaver 0.2.1)

Post by AnonEmoose »

zeniko wrote:AnonEmoose: Many thanks for the testing and the installer. I modified the summary above accordingly.

AnonEmoose wrote:1 minor thing is that the user needs to add the line to their user.js or prefs .js (with Mozilla closed) in order to take advantage of the pref

user_pref("crashrecovery.sessionsaver", false);


Doesn't Mozilla support about:config? Or are you asking for a dialog for this one option? Anyway, if you want to take advantage of the pref in the above way, you'd have to set it to true.

My pleasure... I use both Mozilla & FireFox so it was no big effort on my part..... and thank you :-) ... about the pref thing... I knew how to use the pref (and yes u are correct, about:config method works too).... No need for a dialogue box...I was just trying to give a detailed feedback.... hehehe

To clarify my point above... The extension installation is slightly different (by design) on mozilla than in FireFox... I was just pointing out for anyone who wants to use that particular feature on mozilla, that the complete pref would have to be manually added since the crashrecovery.js will not be added.... unlike FireFox which will install the crashrecovery.js.
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

AnonEmoose: Thanks for the clarification. I wasn't aware of the fact that Mozilla doesn't (yet) recognize an extension's default preferences.

ajhubble wrote:Hmmm, an extension called "Crash Recovery" could be expanded to other things that go haywire when Firefox crashes. What about fiddling around with the caching code to make it so it doesn't throw out the entire cache on a crash?


That would surely be nice. However this functionality seems to be hard coded into the Gecko engine itself, making it unchangeable by extensions. The reasons for this are explained in Bug #105843 (the problem consists mainly in the fact that part of the cache is kept in memory and risks getting corrupted at the crash). Always keeping a copy of the cache around would be quite a resource hog (copying ~50 MB at each startup takes quite some time), and I'm not even sure that an extension could really restore the cache with the browser already running.

Should you (or anybody) have any idea of how this could be done efficiently, I'd be willing to give it a try. Until then your best option is to vote for the mentioned Bug #105843 and hope that someone takes care of it.
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post by AnonEmoose »

zeniko wrote:AnonEmoose: Thanks for the clarification. I wasn't aware of the fact that Mozilla doesn't (yet) recognize an extension's default preferences.
Actually it does, but to make a long story short,Both Mozilla & firefox used the same method originally.... But Firefox got a new extension install overhaul at v0.9 ...

Just for reference, u can do it ( have some script check if the pref is there or not each time the extension loads and then add it if needed) but truthfully it's not worth the effort in this case (and the additional lines of code in the install.js) ... lol ... especially since u can just add it manually.....
http://www.bengoodger.com/software/mb/e ... sions.html
a brief explanation of how the new method differs from the old one is in the Tips & trick section at the end of the page
yegor
Posts: 12
Joined: October 26th, 2003, 5:29 am

Post by yegor »

For some reason Firefox does nothing when one chooses Open in download dialog.
Save & open via File menu works fine.
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

yegor wrote:For some reason Firefox does nothing when one chooses Open in download dialog.
Save & open via File menu works fine.


After downloading an extension, you have to load it either through File -> Open File... or by dragging it over a Firefox window. Open in the download dialog hands the file over to the operating system, which usually doesn't know what to do with it.
Luftpost
Posts: 460
Joined: October 11th, 2003, 7:54 am

Post by Luftpost »

I'm somewhat nervous about using crash guard or similar features in sessionsaver/TBE,because I occasionally go to test sites that will loop and crash browsers. If crashguard is running, wouldnt that lead to the browser crashing again and again?

Of course, you could run firefox in safemode, but that would be a work around at best and a troublesome one at that. Perhaps best would be to configure a popup saying that it detected a crash and asked you if you wanted to recover.
old zeniko
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old zeniko »

Luftpost wrote:Perhaps best would be to configure a popup saying that it detected a crash and asked you if you wanted to recover.

And that's precisely what happens as of version 0.3.1. If you decide not to recover, you'll find the active URLs of all tabs in the hidden pref crashrecovery.backup (just in case you still need them).

Further enhancements are the possibility to change the minimal interval during which Crash Recovery won't access your harddisk (using the hidden pref crashrecovery.save_interval) and the discarding of all session data at regular shutdowns (better respecting your privacy - however this doesn't apply if session saving is activated).

On a separate note: if you use Download Statusbar, make sure that you've installed version 0.9.2, as a bug in the official version 0.9.1 prevents Crash Recovery (and also SessionSaver) of correctly detecting regular shutdowns.
rizwank
Posts: 6
Joined: September 17th, 2004, 5:05 pm

Full functionality

Post by rizwank »

So I understand...

If I want FF to auto save my open tabs when I close FF, and when FF crashes, can I do it just with CrashRecovery or do I have to use Session saver (as well?) --- I can't get session saver to do crash recovery or CR to get regular quit restore either...
yegor
Posts: 12
Joined: October 26th, 2003, 5:29 am

Post by yegor »

In my case neither SS nor CR restore previous session automatically :(
In case of SS I have to restore last session manually from menu.
In case of CR have crashrecovery.sessionsaver set to true but it does not restore anything although I think it restored first time but not sure already.
I have WinXP Pro+SP2, FF 1.0
Installed extensions: Single Window, Dom Inspector, Flashblock, disabled CromEdit, IEview, Tabbrowser Prefs, Show Old Extensions, miniT, GMail Notifier, undoclosetab, SessionSaver.
AnonEmoose
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post by AnonEmoose »

testing feedback:
v0.3.1 totally borks my profile in Mozilla as an upgrade to 0.3, so i restored my profile and did a clean install (not an update) for Crash Recovery, it installs fine but crashing recovery function doesn't work (sessionsave works though). (no worries though, i went back to version 0.3)....
*************************************************

Luftpost wrote:I'm somewhat nervous about using crash guard or similar features in sessionsaver/TBE,because I occasionally go to test sites that will loop and crash browsers. If crashguard is running, wouldnt that lead to the browser crashing again and again?

Of course, you could run firefox in safemode, but that would be a work around at best and a troublesome one at that. Perhaps best would be to configure a popup saying that it detected a crash and asked you if you wanted to recover.
or just while firefox/mozilla is closed u can delete the pref(s) user_pref("crashrecovery.window[0]" where [0] stands for a number(s)


rizwank:
there is no reason to install BOTH SessionSaver & Crash Recovery, use either one but not BOTH.

yegor:
disable all your extensions except Crash Recovery to see if it begins to work.. then enable one by one to see which (if any) is a conflict.
Locked