Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Saving and reusing Sessions in KM 75
Posted by: JamesD
Date: November 26, 2014 03:15PM

Instructions for the ResSessions system

1. Purpose

To provide a way to copy, store, and reuse the files needed for sessions in KM 75x.

2. Requirements

This system uses WScript and the command line version of 7-Zip. Currently there is no
system for WSscript in Linux. At least that is what I have heard. The command line
version of 7-Zip on the author's system is located at:
C:\\Program Files\\7-Zip\\7zG.exe

That is hard coded into ResSessions.js in two places. (Line numbers 18 and 24)
If your command line 7-Zip is elsewhere, you must change those references.

3. Method (creating)

The menu item appears under T00LS as "Export Sessions as 7z". Clicking that menu will
allow the user to choose a location for the compressed 7z file which will be built.

Since this action must happen after closing KM, the system stages an action to happen
when the user exits KM. Note, do not use KM restart because that restarts KM too fast
for this system to work.

When KM has been exited, the ResSessions.js file will run on a short delay to copy and
compress the files "sessionCheckpoints.json" and "sessions.json" into a single file
named "KMSessions.7z" at the location previously chosen. Alert messages from WScript
will keep the user informed of the progress and completion.

4. Method (using)

To restore the sessions' information to a profile, right-click on the file and select 7-Zip.
Extract the files into the profile where you need them.

Attachments: ResSessionsPgm.7z (2.3 KB)  
Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: George Hall
Date: November 26, 2014 07:21PM

That is just backing up Sessions files for K-Meleon 75 Beta 1 not importing or exporting them.

Your method would not allow us to import sessions from other versions of K-Meleon such as K-Meleon 74.0.

Which would be more usefull than just backing up the session files.

Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: guenter
Date: November 26, 2014 07:41PM

Quote
JamesD


That is hard coded into ResSessions.js in two places. (Line numbers 18 and 24)
If your command line 7-Zip is elsewhere, you must change those references.

Have You ever though of using %PROGRAMFILES% or/and %PROGRAMFILES(X86)% instead?
Or does not this work in such code files?

C:\Program Files and C:\Program Files (x86) (only in 64-bit version) is only for English systems.

http://www.askvg.com/list-of-environment-variables-in-windows-xp-vista-and-7/


p.s. http://www.mono-project.com/docs/about-mono/languages/visualbasic/ maybe also for Linux?

Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: siria
Date: November 26, 2014 08:11PM

Quote
guenter
Have You ever though of using %PROGRAMFILES% or/and %PROGRAMFILES(X86)% instead?

Hmm.... now wondering, if it's in the official program folders, perhaps the path can even be dropped completely? Dimly remember that e.g. notepad.exe needs no path either... but could remember wrong... just an idea to test.

Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: JamesD
Date: November 26, 2014 09:49PM

Quote
George Hall
That is just backing up Sessions files for K-Meleon 75 Beta 1 not importing or exporting them.

Your method would not allow us to import sessions from other versions of K-Meleon such as K-Meleon 74.0.

While it is true than you cannot import from a prior version, you can import the sessions from one KM 75 profile to another KM 75 profile. See Method (using).

I have no idea how to pick apart a set of sessions prefs and even less knowledge of how the new one (json) is designed.

@ guenter and siria

Just to note, the notepad.exe path is in the path variable. The 7zG.exe path is not. I can try looking in the registry, but I have little hope for success. What do you think of the idea of putting 7zG.exe in root\tools? I have to read their license to see if that distribution is allowed.

Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: JamesD
Date: November 27, 2014 12:03AM

Just a thought, I had. Did Dorian already fix the method of copying from KM 74 to KM 75?

Quote
Dorian
Sessions:
- New storage file. Sessions are imported in sessions.js then deleted from prefs.js

Use CarrySession to put prefs from KM 74 into KM 75 and let KM 75 convert them. I have not tried, but it might work.

Of course it won't go the other direction, but for that you might try Groups.

Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: George Hall
Date: November 27, 2014 05:31AM

Quote
JamesD
Just a thought, I had. Did Dorian already fix the method of copying from KM 74 to KM 75?

Quote
Dorian
Sessions:
- New storage file. Sessions are imported in sessions.js then deleted from prefs.js

Use CarrySession to put prefs from KM 74 into KM 75 and let KM 75 convert them. I have not tried, but it might work.

Of course it won't go the other direction, but for that you might try Groups.

I have already tried that and they did not import.

If CarrySession imported sessions into sessions.js then it may be possible to import sessions from K-Meleon 74.

If that works it may be possible to export sessions from sessions.js so that they can be impoted to K-Meleon 74.

Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: JamesD
Date: November 27, 2014 12:55PM

Quote
George Hall
If CarrySession imported sessions into sessions.js then it may be possible to import sessions from K-Meleon 74.

In a perfect world, that would be the goal. However, that level of coding is beyond me. For CarrySession, I only needed to reproduce the set of prefs. I did not have to know what information was in each pref.

To work from 74 to 75, I would have to pull apart each pref and then put all the information into a json file. I don't have a clue to what the text and spacing of a session pref represent. Also the macro language does not have the ability to write to a json file.

Do you have to use sessions? Do you need more than the list of tabs open and what URL is shown in each tab? If you answer 'no' to both questions, then the Groups extension might suffice. It has export/import features.

I would like to offer a better solution, but I have neither the knowledge nor the tools to do so.

Options: ReplyQuote
Re: Saving and reusing Sessions in KM 75
Posted by: siria
Date: November 27, 2014 07:28PM

Am sure Dorian will fix it, and until then, perhaps the old sessions-plugin may still work, as in the past some old plugins have continued working fine when the newer ones were buggy yet. But only a test will show.
I really like that he's storing sessions now in separate files, not mixed into browser prefs. That makes backups easier when someone wants to store only prefs or only sessions. So I wouldn't even spend much time programming a new macro, if all it takes in the future is to copy those two files.
Unless someone wants to exchange only single sessions of course. But then groups or bookmark-folders are probably handier anyway.



Edited 1 time(s). Last edit at 11/27/2014 07:29PM by siria.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.