Session Saver 0.2 & Bookmark Backup 0.2

Talk about add-ons and extension development.
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Session Saver 0.2 & Bookmark Backup 0.2

Post by Pike »

Here's another couple of small Firebird extensions:

Session Saver 0.2
Remembers loaded tabs and their history items when Firebird is manually closed, then restores the tabs and history items when next started. The saved session can also be manually restored or updated at any later time via the items in the File menu.

At the moment there are no limits on how much data is saved, so if you have 100 tabs opened each with 10 history items then this extenison will save all 1000 URLs into your prefs.js (which may slow down the next startup somewhat :)).

Updates
0.2
  • Now treats the tabs from windows closed within 10 seconds of each other as part of the same set. For example, if you have two windows open and close them both within 10 seconds (thus exiting Firebird), the tabs of both windows will be opened next time Firebird is started (all saved tabs will open in a single window even if they were originally saved from multiple windows). This setting can be adjusted via sessionsaver.settings.append_interval (time in milliseconds).
0.1.1
  • Fixed a conflict with TBE.

Bookmark Backup 0.2
An extremely basic extension that creates a backup of the bookmarks file each time Firebird is closed. The backups can be found in the Firebird profile directory. They will be named bookmarks.html.<day> e.g. bookmarks.html.sun, bookmarks.html.mon, bookmarks.html.tue, etc. If Firebird's bookmarks become corrupted or lost simply find the backup for the previous day and rename it to bookmarks.html (if necessary delete the corrupted version first).

Updates
0.2
  • The backup location can now be specified in Bookmark Backup's Options window.
0.1.2
  • Now supports the backup of a bookmarks file that has been moved with browser.bookmarks.file.
0.1.1
  • Bookmark backups now stored in a sub-directory of the profile directory named Backups.

Both can be found here:

http://www.pikey.me.uk/mozilla/
Last edited by Pike on October 31st, 2003, 7:39 am, edited 11 times in total.
clav
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK
Contact:

Post by clav »

get a mozdev project :)
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Nice

Post by jedbro »

Very nice Pike:
Unfortunatly I can't install either pop-up count or session saver, the server gives me the following error:

Forbidden
Remote Host: [208.185.127.157]
You do not have permission to access http://pike.s5.com/mozilla/extensions/popupcount.xpi
Data files must be stored on the same site they are linked from.
Thank you for using FreeServers

Secondly, is there a way to get the Session Saver to only load if Firebird isn't closed correctly (i.e. on a crash)?
Thanks

p.s. When you get a chance, if you could submit your extensions to database[at]mozdev.org that would be awesome:
extension's name, size, install url, small description, long description, and the authors name, e-mail and/or website and ScreenShot URL's with captions for each image..
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Re: Nice

Post by Pike »

jedbro wrote:Very nice Pike:
Unfortunatly I can't install either pop-up count or session saver, the server gives me the following error:

Forbidden
Remote Host: [208.185.127.157]
You do not have permission to access http://pike.s5.com/mozilla/extensions/popupcount.xpi
Data files must be stored on the same site they are linked from.
Thank you for using FreeServers

My first guess would be that you have referrering disabled, this host unlike the other one doesn't allow hot-linking. I just tried installing each one and they were all OK except Popup Count doesn't want to install for some reason, I tried reuploading but it didn't make any difference :( (The current version of Popup Count is available on my normal host, see the [website] link at the bottom of this post).

jedbro wrote:Secondly, is there a way to get the Session Saver to only load if Firebird isn't closed correctly (i.e. on a crash)?

Not at the moment no, I think it might be possible to do this, I'll think about it for the next version.
clav
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK
Contact:

Re: Nice

Post by clav »

Pike wrote:
jedbro wrote:Secondly, is there a way to get the Session Saver to only load if Firebird isn't closed correctly (i.e. on a crash)?

Not at the moment no, I think it might be possible to do this, I'll think about it for the next version.


set a bool pref on window close (e.g. "extensions.session-restore.shut-down-ok"), and check it on startup, and then clear it. if Fb crashes the pref won't be set

?
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Re: Nice

Post by Pike »

clav wrote:set a bool pref on window close (e.g. "extensions.session-restore.shut-down-ok"), and check it on startup, and then clear it. if Fb crashes the pref won't be set

?


I already figured that bit out but the tricky bit is constantly updating the saved session data whenever a new tab is opened or a link is followed (I haven't had much luck with ProgressListeners they seem to break the browser whenever I try them :(). I assumed that was what Jed meant anyway.
User avatar
soccer_dude182
Posts: 720
Joined: July 11th, 2003, 10:50 pm
Location: Waco, TX

Re: Session Saver 0.1 & Bookmark Backup 0.1

Post by soccer_dude182 »

Pike wrote:Here's another couple of small Firebird extensions:

Session Saver 0.1
Remembers loaded tabs and their history items when Firebird is shutdown, then restores the tabs and history items when next started. The saved session can also be manually restored or updated at any later time via the items in the File menu.

At the moment there are no limits on how much data is saved, so if you have 100 tabs opened each with 10 history items then this extenison will save all 1000 URLs into your prefs.js (which may slow down the next startup somewhat:)).


i have a quick question. is this session save just for when firebird abruptly shuts down (when it hangs up or is forced to close due to an error) or does this save the tabs everytime manually close firebird? thanks.

ps. i really like the bookmark backup extension. thanks a lot!!!
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Re: Session Saver 0.1 & Bookmark Backup 0.1

Post by Pike »

soccer_dude182 wrote:i have a quick question. is this session save just for when firebird abruptly shuts down (when it hangs up or is forced to close due to an error) or does this save the tabs everytime manually close firebird? thanks.

It remembers what tabs (and history) were open whenever you close Firebird then it reloads them when you start FB up again. Since it only updates the saved session when you close Firebird it won't restore you from a crash.
clav
Posts: 1974
Joined: November 5th, 2002, 3:25 am
Location: Lancaster, UK
Contact:

Post by clav »

how does it handle multiple windows?

(not that i use them. i'm just curious)
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Post by Pike »

clav wrote:how does it handle multiple windows?

(not that i use them. i'm just curious)

It doesn't at the moment, I guess that's something I need to think about. It just remembers the last window that was closed, but now that you said that I just realised if you have 2 windows open and select File->Exit then the saved window will effectively be random :(.
jedbro
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
Contact:

Re: Nice

Post by jedbro »

Pike wrote:
clav wrote:set a bool pref on window close (e.g. "extensions.session-restore.shut-down-ok"), and check it on startup, and then clear it. if Fb crashes the pref won't be set

?


I already figured that bit out but the tricky bit is constantly updating the saved session data whenever a new tab is opened or a link is followed (I haven't had much luck with ProgressListeners they seem to break the browser whenever I try them :(). I assumed that was what Jed meant anyway.


Kind of, I'm more interested in a "Crash recovery" feature than anything else.
Clav's idea seems to be the way to do it.

The problem is, I don't want Firebird to always load where I left off on my last sesion. I'd prefer it did so ONLY when the browser didn't properly exit.

Is this something you'd implement as a feature, or should I branch off your code for personall use?
User avatar
frease
Posts: 3981
Joined: September 16th, 2003, 1:17 pm

Post by frease »

When is Session Saver going to be available for download? Can't wait to try it. I am too tired of TBE which slows everything down.
User avatar
Pike
Posts: 2293
Joined: August 10th, 2003, 12:12 pm
Location: UK
Contact:

Re: Nice

Post by Pike »

jedbro wrote:Kind of, I'm more interested in a "Crash recovery" feature than anything else.
Clav's idea seems to be the way to do it.

The problem is, I don't want Firebird to always load where I left off on my last sesion. I'd prefer it did so ONLY when the browser didn't properly exit.

Is this something you'd implement as a feature, or should I branch off your code for personall use?

Yeah Crash Recovery is what I was referring to in my reply to clav, at the moment changes are only made at manual shutdown so there is zero crash recovery. I would have to make it so it updated the saved session data everytime a new tab was opened or a link was followed, which I'm not too sure how to do with out trying it out. I might have a go in the next few days, but feel free to use my code as a base for your own attempt if you like.

frease wrote:When is Session Saver going to be available for download? Can't wait to try it. I am too tired of TBE which slows everything down.

It is already available here:
http://pike.s5.com/mozilla/#ss (Now removed.)

If you are having problems downloading it then I'm afraid you'll have to wait until my real host lets me back in, I'll update this thread when that happens.

Edit: Aargh that link was working earlier and now it doesn't, sorry.
Last edited by Pike on October 4th, 2003, 10:00 am, edited 1 time in total.
User avatar
Paradox52525
Posts: 1219
Joined: April 23rd, 2003, 9:13 am
Location: Middle of nowhere
Contact:

Post by Paradox52525 »

Just wanted to post to say that I think Bookmark Backup is an excellent idea and very well implemented. I do have two few suggestions for future versions though:

1. How about using a date instead of day abbreviations? I assume you used day abbreviations so they will eventually be overwritten (the next week) and not pile up in the profile directory, but I think there are probably better ways to do this, like adding an option for how long to keep backups (ie, keep backups from the part 5 days, ect, and any older backups will get deleted).

2. Allow the user to specify the directory to put bookmark backups in, or make a new folder in the profile directory for bookmark backups rather than putting them in the root profile directory. This is a minor nitpicky thing, but I think it would help keep users' profile directories more organized and make it easier to keep track of backups.

Just my two cents anyway ^_^, again thanks for a great extension!
User avatar
James
Moderator
Posts: 27999
Joined: June 18th, 2003, 3:07 pm
Location: Made in Canada

Post by James »

This look like it is promising but I would like it to restore session after a crash, but not after a manual exit though.
Post Reply