MozillaZine

Session Manager 0.1 to 0.3.9+

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

Post Posted February 11th, 2006, 6:50 pm

This thread has been replaced:

<li>Session Manager Homepage
<li><a href="http://www.haslo.ch/zeniko/software/sessionmanager.xpi">Latest version</a>
<li>New discussion thread

Thanks for the additional click...
Last edited by old zeniko on April 17th, 2006, 10:45 am, edited 77 times in total.

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

Post Posted February 12th, 2006, 6:11 pm

The current release, <a href="http://www.haslo.ch/zeniko/software/sessionmanager.xpi">Session Manager 0.2</a>, adds a automatic tab reloading and a toolbar button for access to all functions/settings (which still needs an icon on its own).

If you want to control Session Manager with the keyboard, you can add the following keyconfig keys:
* Save the current session (same as hitting the toolbar button):
Code: Select all
SessionManager.save();

* Load a specific session:
Code: Select all
SessionManager.load(session_filename);

* Open the session folder:
Code: Select all
SessionManager.openFolder();

* Display the toolbar button's drop-down menu:
Code: Select all
document.getElementById("sessionmanager-toolbar").open = true;

NewBDoB
 
Posts: 52
Joined: February 12th, 2005, 9:28 pm

Post Posted February 12th, 2006, 11:07 pm

zeniko wrote:<a href="http://www.haslo.ch/zeniko/software/sessionmanager.xpi">Session Manager</a> saves and restores the state of all windows.
This release works for Firefox 1.5.


Any plans to support SeaMonkey?

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

Post Posted February 13th, 2006, 12:09 pm

NewBDoB wrote:Any plans to support SeaMonkey?

Sure, as of <a href="http://www.haslo.ch/zeniko/software/sessionmanager.xpi">v0.2.2</a>. However, as a side effect of SeaMonkey's hideous installation framework, you'll have to install <a href="http://www.haslo.ch/zeniko/software/crashrecovery.xpi">Crash Recovery</a> first.

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

Post Posted February 13th, 2006, 6:18 pm

zeniko wrote:<a href="http://www.haslo.ch/zeniko/software/sessionmanager.xpi">Session Manager</a> saves and restores the state of all windows.

Building upon Crash Recovery, this extension allows you to save the current state of Firefox (history, text data, cookies) and return to that state at any later moment. Besides the manually saved states, Session Manager automatically stores the current state in case of a crash. If you don't set the "Resume Current Session At Startup" option, the current state will be cleared when you close the browser.


Fantastic! I can't say enough good things. Simple to use, intuitive and streamlined... Excellent & Thank you!!

logan

User avatar
 
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403

Post Posted February 13th, 2006, 9:19 pm

Looks good.

I noticed there's prefs under extensions.sessionmanager.* and extensions.crashrecovery.*. A minor nit to be sure, but maybe it'd be best to have 'em all under the same prefbranch so people looking around in about:config are able to see everything by filtering for the obvious (session(manager)).

sessions/* seems like a custom file format. I've no preference here, but RDF may be a bit simpler to manage. TabMixPlus uses RDF (sessions.rdf), SessionSaver 0.2d just uses prefs.

The scroll position stuff is nice, but doesn't appear to handle frames. I've been working on a (private) extension to workaround bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=215405">215405</a> and have some of that handy, you'd just need to find a way to store it...
Code: Select all
        var frames = getBrowser().contentWindow.frames;
 
        for(var i = 0; i < frames.length; i++)
          entry.frames[i] = { x: frames[i].scrollX, y: frames[i].scrollY };

and after
Code: Select all
            if(entry.frames.length == frames.length)
              for(var i = 0; i < frames.length; i++)
                if(!frames[i].scrollX && !frames[i].scrollY &&
                   (entry.frames[i].x || entry.frames[i].y))
                  frames[i].scrollTo(entry.frames[i].x, entry.frames[i].y);

(probably similar to sessionsaver 0.2d)

Is there a way to disable saving and restoring of post/form data? I see the .postdata pref, but at first glance don't know if it's for internal usage or what. The main reason I ask is that ss 0.2d seems to have (or has had) problems with slow script dialog when doing file uploads. If the data is above a certain size (say 250kb) and is not already ignored, you may want to do that. Some boolean prefs to disable one/both may not be a bad idea...

I'm not sure if you're aware of this, but session saving in one form or another is supposed to be coming to Firefox 2.0 and work will be starting shortly. I'm sure everyone would appreciate code contributions. Bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=36810">36810</a> appears to be the main one, but it's listed under suite, so I'm not real sure... I've also seen bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=159357">159357</a>. Anyone??

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

Post Posted February 14th, 2006, 8:30 am

logan wrote:I noticed there's prefs under extensions.sessionmanager.* and extensions.crashrecovery.*.

This is intentional since I intend to keep the session saving component (Crash Recovery) independent of the session managing front-end. And obviously this pref-splitting shouldn't confuse anyone who dares to load about:config (which isn't for Joe User anyway).
logan wrote:sessions/* seems like a custom file format. I've no preference here, but RDF may be a bit simpler to manage. TabMixPlus uses RDF (sessions.rdf), SessionSaver 0.2d just uses prefs.

I originally tried to use an RDF format similar to TMP's, but handling the data in that form was so much of a PITA that I settled on a specialized and yet extensible text format. These files can be parsed very easily, should it really be necessary. OTOH, the problem with preferences is that saving a session can quickly double prefs.js, and an additional import/export facility would be required for moving sessions around.
logan wrote:The scroll position stuff is nice, but doesn't appear to handle frames.

There are still some things missing, and some other things will never make it at all. This particular issue will be fixed in the next release.
logan wrote:Is there a way to disable saving and restoring of post/form data?

Currently the .postdata pref indicates up to how many bytes of POSTDATA should be restored (-1 = all of it, 0 = none). In the next release, it will also limit POSTDATA saving (for better performance).
logan wrote:I'm not sure if you're aware of this, but session saving in one form or another is supposed to be coming to Firefox 2.0 and work will be starting shortly.

Work's already started at wiki.mozilla.org (here's the current status).

C@rb0n
 
Posts: 1425
Joined: February 19th, 2005, 11:22 am

Post Posted February 14th, 2006, 12:18 pm

Unfortunately, this restores only the last active window, discarding other windows. Is there a setting to resolve this? I have set extensions.crashrecovery.resume_session to true

Also, the Sessionmanager component does not work. All it shows is "Session Manager" with an empty submenu under the Tools menu.

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

Post Posted February 14th, 2006, 12:34 pm

C@rb0n wrote:Unfortunately, this restores only the last active window, discarding other windows. Is there a setting to resolve this? I have set extensions.crashrecovery.resume_session to true

Do you close all windows in sequence or are you quitting through File -> Exit (only the latter will restore all windows)? And is this with Firefox or SeaMonkey?
C@rb0n wrote:Also, the Sessionmanager component does not work. All it shows is "Session Manager" with an empty submenu under the Tools menu.

That was an issue with v0.2.2. Make sure that you've got v0.2.2.1 installed.

logan

User avatar
 
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403

Post Posted February 14th, 2006, 12:35 pm

SessionSaver (0.2) checks the window closes times and appends the session history if it falls under a certain threshhold.
Code: Select all
                // Calculate whether to append to existing session based on time since last window close
                var appendSession = false;
                try
                        var currentTime = new Date().valueOf();
                        var lastChecked = this.prefBranch.getCharPref(lastClosePrefName);
                        if (currentTime - lastChecked <= this.appendInterval) appendSession = true;
                catch (err) {}

If you kill the process, all windows are properly restored.

C@rb0n
 
Posts: 1425
Joined: February 19th, 2005, 11:22 am

Post Posted February 14th, 2006, 1:32 pm

zeniko wrote:
C@rb0n wrote:Unfortunately, this restores only the last active window, discarding other windows. Is there a setting to resolve this? I have set extensions.crashrecovery.resume_session to true

Do you close all windows in sequence or are you quitting through File -> Exit (only the latter will restore all windows)? And is this with Firefox or SeaMonkey?

I'm using Firefox 1.5.0.1, and I did File -> Restart (because I have the "Restart Firefox" extension installed)
zeniko wrote:
C@rb0n wrote:Also, the Sessionmanager component does not work. All it shows is "Session Manager" with an empty submenu under the Tools menu.

That was an issue with v0.2.2. Make sure that you've got v0.2.2.1 installed.

I am using v0.2.2.1

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

Post Posted February 14th, 2006, 4:09 pm

@C@rb0n:
The first issue is due to a "bug" in "Restart Firefox": it never calls canQuitApplication() (which notifies all extensions of the shutdown). I recommend to contact its author about that issue.
The second one is probably a startup bug due to a registration or extension compatibility issue. Do you get any errors or warnings in the Console (make sure that javascript.options.showInConsole is set to true if you don't use Console²)?

@logan:
First one word of caution: SessionSaver's code is not open-source. Although it is publicly available, it can't be used or even discussed without admission by rue.
That beside, I didn't know about that feature. Although having observed it, I assumed it was a bug. Anyway, I prefer not having to try to be clever about the user's intentions. That feature won't thus make it into Crash Recovery (for now).

logan

User avatar
 
Posts: 3453
Joined: May 22nd, 2003, 3:51 pm
Location: NGC 2403

Post Posted February 14th, 2006, 5:11 pm

zeniko wrote:First one word of caution: SessionSaver's code is not open-source. Although it is publicly available, it can't be used or even discussed without admission by rue.

That was taken from 0.2 (not the rewrite). There's no license of any sort in the original, merely a comment at the top of each file stating the version and authors name, so public domain.

From 0.2d:
Licensing available upon request.
-rue

I'm not quite sure what to make of this, but if it is how you say it is ... seems ludicrous.

zeniko wrote:Anyway, I prefer not having to try to be clever about the user's intentions. That feature won't thus make it into Crash Recovery (for now).

I rarely have more than one window open anyway, so that's not an issue for me.

C@rb0n
 
Posts: 1425
Joined: February 19th, 2005, 11:22 am

Post Posted February 14th, 2006, 8:43 pm

zeniko wrote:@C@rb0n:
The first issue is due to a "bug" in "Restart Firefox": it never calls canQuitApplication() (which notifies all extensions of the shutdown). I recommend to contact its author about that issue.
The second one is probably a startup bug due to a registration or extension compatibility issue. Do you get any errors or warnings in the Console (make sure that javascript.options.showInConsole is set to true if you don't use Console²)?

Thanks. I have sent the author an email.

As for the second item, javascript.options.showInConsole is set to true, but I see no errors in the console.

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

Post Posted February 15th, 2006, 1:41 am

All right. Try <a href="http://www.haslo.ch/zeniko/software/sessionmanager.xpi">v0.2.3</a> then. If it still doesn't work, you might want to try a clean profile...

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests