MozillaZine

[Ext] Crash Recovery 0.6.10 [discontinued]

Talk about add-ons and extension development.
Jomel

User avatar
 
Posts: 133
Joined: September 30th, 2004, 1:10 pm

Post Posted November 27th, 2005, 1:31 pm

By the way I wrote my own crash recovery extension, imaginatively called Crash Recovery Lite, designed from the ground up for speed. Consequently, it is so quick you won't notice it (unlike SessionSaver :roll:), but it only saves the addresses of all tabs in all windows and (optionally) restores them on next startup (that's right, no text restoring, scroll position save, or restoring tabs after closing the browser normally). Those of you who don't need these and other features of SessionSaver and care about speed take notice!

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted January 23rd, 2006, 4:22 pm

As a middle way between Crash Recovery Lite and Tab Saver! on the one side and SessionSaver and Tab Mix Plus on the other, <a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">Crash Recovery</a> is back.

The functionality is still about the same (history, text and cookie saving), it is just better integrated into Firefox. You can get the optional session resuming by prepending your homepage with about:crashrecovery? and still adapt the saving interval (extensions.crashrecovery.interval). The data is now saved into a text file in your profile folder and a backup is created after a crash. Finally, it should prevent the cache being emptied after a crash (feature provided by Cache Fixer).

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted January 24th, 2006, 1:52 pm

The first minor update, <a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">Crash Recovery 0.5.1.1</a>, restores SeaMonkey compatibility and fixes some minor bugs (debug messages in Console and cookies from localhost ignored).

AnonEmoose
 
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post Posted January 26th, 2006, 6:43 pm

kudos on a job well done. I like the way this is written as a component and as you said lean & mean

Can I suggest 2 things (this might be feature bloat, though)

1. Since there you've created the "crashrecovery" component factory how hard would it would it be to implement an "On Demand Restore" by typing "about:crashrecovery" in the location bar, currently it displays the contents of the crashrecovery.dat instead of executing the "restoring" function (or perhaps can u provide the command syntax I could use in the keyconfig extension; It seems the code is all there but I I wasn't able to succesfully call the function)

2. An option (off by default) to save 'X' number of crashrecovery.dat files (instead of deleting/overwriting it on start) eg. crashrecovery-2006-01-26.dat, crashrecovery-2006-01-25.dat, crashrecovery-2006-01-24.dat ..... etc. this could be used as a minimilist method of restoring a prior lost session

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted January 26th, 2006, 9:22 pm

You seem to want to mis-use Crash Recovery as a session manager... ;-)

1. crashrecovery.dat always contains the current state of the browser, so restoring from it would be pointless. If you want to restore a session, you'd rather need some way of telling Crash Recovery where to get the data from. Probably the best I could do here would be to expose the CrashRecoveryService object in the window so that you could use it from JavaScript (resp. you could then write any UI for managing sessions for it). I'll look into it.

2. Do you really think that anybody would come back to a lost session if he/she doesn't right after the crash? You most probably wouldn't even know what that session consisted of. Now, just in case getting back to it fails, Crash Recovery creates on backup (crashrecovery.bak), so that you could extract the relevant data manually (before closing the browser(!), since all session data is removed if session resuming is disabled). I'm not sure how multiple backups would help here (and whether to delete them at a successful shutdown or not). In any case, you could always make backups through an extension (e.g. with Bookmark Backup which could collect crash data for at least 7 days). I'll think about it.

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted January 27th, 2006, 6:37 am

<a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">Crash Recovery 0.5.3</a> is now scriptable enough for it to function as the base of some light session manager:
Code: Select all
var gCRService = Components.classes["@zeniko/crashrecoveryservice;1"]
    .getService(Components.interfaces.nsICrashRecoveryService);
/* to get a string representation of the current state: */
var state = gCRService.getCurrentState();
/* to restore a state in the current window
 * (if overwrite is true, all existing tabs will be closed): */
gCRService.restoreWindow(window, state, overwrite);

AnonEmoose
 
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post Posted January 27th, 2006, 6:24 pm

zeniko wrote:You seem to want to mis-use Crash Recovery as a session manager... ;-)
just slightly ;)

zeniko wrote:1. crashrecovery.dat always contains the current state of the browser, so restoring from it would be pointless. If you want to restore a session, you'd rather need some way of telling Crash Recovery where to get the data from.
exactly my thoughts

zeniko wrote:<a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">Crash Recovery 0.5.3</a> is now scriptable enough for it to function as the base of some light session manager:
Code: Select all
var gCRService = Components.classes["@zeniko/crashrecoveryservice;1"]
    .getService(Components.interfaces.nsICrashRecoveryService);
/* to get a string representation of the current state: */
var state = gCRService.getCurrentState();
/* to restore a state in the current window
 * (if overwrite is true, all existing tabs will be closed): */
gCRService.restoreWindow(window, state, overwrite);


perfect!!

Now, playing with the 'state' string should yield what I'm after....
many thanks!!

yujiro
 
Posts: 3
Joined: September 5th, 2005, 5:51 am

Post Posted February 7th, 2006, 6:41 am

My name is Yujiro Nakamura, an editor of "Windows Forest"
http://www.forest.impress.co.jp/
a webzine about Windows online software at Impress Watch Corporation,
Tokyo, Japan.

Our website "Windows Forest" is known as an online software directory
service in Japan, and we have 34 millions pageviews per month. We owe
this figure to every online software author and users of our website.

We will announce you that we introduced your excellent software

Crash Recovery

today in our news article. Its URL is shown below.
We are sorry that no english page is available.

http://www.forest.impress.co.jp/article ... overy.html

We thank you and if your software is updated or new software is
released, please tell us.

We appriciate your business,

Windows Forest
Yujiro Nakamura, Editor

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted February 11th, 2006, 7:13 pm

As a demonstration of Crash Recovery's session saving/restoring features, I've written a simple front-end called Session Manager which is quite similar to SessionSaver (although with different idiosyncracies). If you want to try it, make sure to uninstall Crash Recovery before installing Session Manager (since both use the exact same component).

mikcz
 
Posts: 1
Joined: February 15th, 2006, 3:29 am

Post Posted February 15th, 2006, 3:50 am

Hi, I've prepared Czech localization of the Crash Recovery 0.5.3.3. Can you please include cs-CZ into official release?
You can also write your comments (Czech or English) to our support forum.

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted February 20th, 2006, 4:43 am

As Session Manager progresses, there are also some fixes and improvements getting back into Crash Recovery. Here goes <a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">version 0.5.5</a> which adds as a main improvement a third pref to control on which sites sensitive data (form data, POSTDATA and cookies) is saved: extensions.crashrecovery.privacy_level which can be either 0 (always save), 1 (don't save on secure/https sites) or 2 (never save). It also adds two more locales (Czech and Turkish) - thanks to the translators.

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted February 23rd, 2006, 2:27 pm

As of <a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">version 0.5.7</a>, Crash Recovery allows extension authors to easily persist tab specific data:
Code: Select all
/* store your data in the xul:tab as an attribute with a name starting with CR_ */
gBrowser.selectedTab.setAttribute("CR_ExtName_Value", persisingValue);

When the tab is restored, you'll get a CRTabRestoring event when the chrome part of the tab is restored and a CRTabRestored event when the content is restored as well:
Code: Select all
/* listen for CRTabRestoring and restore the value if present */
gBrowser.addEventListener("CRTabRestoring", function(aEvent) {
  var tab = aEvent.originalTarget;
  if (tab.hasAttribute("CR_ExtName_Value")) {
    var value = tab.getAttribute("CR_ExtName_Value");
    // restore the value to where it belongs for your extension
  }
}, false);

This allows extensions such as ImgLikeOpera to retain their functionality without any ugly hacking (see this rant by the extension's author).

Wai_Wai
 
Posts: 166
Joined: July 26th, 2004, 1:05 am

Post Posted March 1st, 2006, 11:19 pm

Hi.
I'm using SeaMonkey 1.0

After I installed CrashRecovery, I couldn't see it in anywhere.
I used Multizilla to check if it was installed properly, but I couldn't see this plugin in the plugin list.

It seems there's something wrong with CrashRecovery.
Any clue?
How to check to make sure if it works?


=============
About my computer:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060130 MultiZilla/1.8.1.1c SeaMonkey/1.0

My extensions are:
- IE View
- Multizilla
- bugmenot
- googlebar
- controledscripts
- automarks
- Filterset.G

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted March 1st, 2006, 11:42 pm

Crash Recovery is designed to be "install and forget". There isn't any UI to it and you should only note that it's there after a crash. If you want to make sure that it works, go to Edit -> Preferences -> Navigator and select for "Display on Navigator Startup" "Last Page Visited". Restarting SeaMonkey with more than one tab open should then restore all tabs. Alternatively, entering the URL about:crashrecovery?about:crashrecovery should show you a debugging screen. And the ultimate test is of course: kill SeaMonkey's process, restart it and watch what's being recovered...

Wai_Wai
 
Posts: 166
Joined: July 26th, 2004, 1:05 am

Post Posted March 4th, 2006, 11:14 am

Hi zeniko,
No it just doesn't exist or doesn't work at all.
- No restoration after crash
- Nothing when I press "about:crashrecovery?about:crashrecovery", or just "about:crashrecovery"

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest