General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
How to get opened last open tabs if ...
Posted by: Voltaire
Date: January 25, 2016 05:00PM

... by mistake, another K-Meleon window was still open?

Situation:
1. K-Meleon normally open with about 40 open tabs.
2. one of the open tabs was opening another K-Meleon window with a chat inside
3. the main K-Meleon instance (with the 40 tabs) was closed
4. by mistake the chat tab was not yet closed (as it was behind)
5. now all the 40 tabs have to be reopened ...

how??????

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: siria
Date: January 25, 2016 07:36PM

Uh oh, am afraid that was it then... Sh*t happens
Oops, was wrong - there IS hope, see rodocops post below!

------
What I would recommend is to use the pref to force ALL links to open as tabs, regardless if they want a "window" or tab (F2>Browsing>Window Diversion)



Edited 1 time(s). Last edit at 01/25/2016 11:53PM by siria.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: rodocop
Date: January 25, 2016 10:03PM

Your profile should contain session.json.bak file - if not now it could be useful the next time you'll get into this trap

Just replace (not starting KM till you make these steps) session.json with that bak-file renaming the latter.

I can't suggest something else.



Edited 1 time(s). Last edit at 01/25/2016 10:03PM by rodocop.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: JamesD
Date: January 25, 2016 11:13PM

A macro which I wrote may be of use. Information on PriorTabs can be found here:
http://kmeleonbrowser.org/forum/read.php?9,137101

If you still have the one window open, PriorTabs has all the tabs closed previously in the session.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: siria
Date: January 26, 2016 12:01AM

Quote
rodocop
Your profile should contain session.json.bak file - if not now it could be useful the next time you'll get into this trap

Just replace (not starting KM till you make these steps) session.json with that bak-file renaming the latter.

Very cool!!
Now wondering how it may work? When is it created (startup? Exit? Crash?) and changed...

And yes, PriorTabs may well help for such accidents too, never realized!
So far my private macro creates a list of closed tabs too, but intentionally did not want it to store all the time to disk, assuming to need it only during sessions anyway. But for accidents with whole windows and sessions, might really be better.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: Voltaire
Date: January 26, 2016 10:11AM

Hi Folks, thanks so far.

Aftwer writing the above "complaint", something quite strange happened:

0. (former situation: the main window was closed, leaving open a chat window)
1. I still kept open the chat-tab.
2. I opened a new instance of KM: it opened with "standard-duckduckgo-tab" (so a "brand new empty window").

at that moment I considered the former tabs to be lost ... but:

3. I closed all KM-windows (so both new duckduckgo-window (first) and former chat-window (second))

4. I reopened a new instance of KM ... and the effect was, that three windows were opened:
a) the former "main window" with all the 40 tabs,
b) the former "duckduckgo-window", and
c) the former chat-window (with expired data as the chat session was closed) ...

Still wondering how to rely on that behaviour and to manage such a case ...

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: siria
Date: January 26, 2016 11:38AM

Aargh... slamming forehead... of course!!
Should have thought of that, knowing that effect full well from the old sessions system! Have no practical experience with the new one, but IF it works similar, it goes like this:

Session pages are only stored at the $OnLoad event, NOT when closing a page! Old known 'bug': if you close some tabs, then close browser *without* loading any new pages anymore, those closed tabs will reappear at next session restore. But as soon as you open a new page, the list gets updated. And highly likely that "about:home" and "about:blank" are excluded from storing, that was your luck!
The only strange thing, that the 3rd window opened again too, but still...



Edited 2 time(s). Last edit at 01/26/2016 11:44AM by siria.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: Voltaire
Date: January 26, 2016 04:56PM

OK, but if that's the behaviour it's not such a problem than I was fearing ... meaning: if in case one of the open windows was closed by mistake, the only advice would be not to open any new tab or window, but close everything, and reopen KM again ...

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: JohnHell
Date: January 26, 2016 05:55PM

Just a suggestion: if those 40 urls are static, why not use a session or a bookmark folder (with a nickname/shortcut) to have all them at hand? (disaster safe options)

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: rodocop
Date: January 26, 2016 09:29PM

adodupan have created an addon (KM-specific, so the pref
kmeleon.install_firefox_extension
should be set to false in order to install this addon.

It makes backups of bookmarks and sessions, as it was described

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: Voltaire
Date: January 27, 2016 08:24AM

Quote
JohnHell
Just a suggestion: if those 40 urls are static, why not use a session or a bookmark folder (with a nickname/shortcut) to have all them at hand? (disaster safe options)

They are not static ... or I would have set Bookmarks or Favourites for them ...

Yep, CaptorGroups is a great thing in NetCaptor ... but NetCaptor does not run above XP (and is no longer supported for more than a decade) ... sad smiley

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: siria
Date: January 27, 2016 10:08AM

Seems there are actually FF-users out there who do collect their bookmarks not in bookmarks, but exclusively in the current session, especially in the FF tab "groups" (whatever that is exactly, but sure must be empty tabs considering the mass).
Up to 700 - was absolutely SHOCKED when coming across this postings!! Or another guy had hoarded some 150 for years...
Came across this phenomenon while doing a quick search for session-storage in FF, and still can't believe it. Such people say they collected their precious session during years! And of course suddenly get into major trouble if not aware that sessions can get lost under special circumstances. Major disaster... The 700-tabs guy was extremely lucky to be able to restore one of his old session-files again, but only after using some undelete-tool for deleted files.
Still cannot grasp some people prefer THIS to favorites or bookmark groups etc.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: Voltaire
Date: January 27, 2016 06:25PM

@rodocop: I'll have a look at that ...

Still using NetCaptor on XP I have a different strategy in using tabs. NetCaptor has two huge advantages: on the one hand the open tabs ape permanently (when opening or closing a tab) saved and update into a file called "last.dat". It is a simple text-file and has the form:

url3=http://kmeleonbrowser.org/
url2=http://kmeleonbrowser.org/forum/
url1=http://duckduckgo.com

ans so on. No code, nothing else; just numbered urls. The file "last.dat" can be copied or renamed at any moment. When renaming it while NetCaptor is stil open it gets recreated with the next tab opening action.

Now it's very nice just to save the last.dat after quitting (just by renaming or copying it).

It is also very nice to manually write such a file and then open NetCaptor: in that way it's possoble to open a list of given urls at once. I needed to use that for 256 tabs of an IP blok: it's easy to write that file with excel (for numbering). Btw. K-Meleon is not able to deal with more than 200 tabs; NC can handle at least 256; maybe lot's more; and it is possible to do such a thing even with a PC with 512MB of RAM (as NC is using MSIE6/7/8)

And the other nice thing with NetCaptor are CaptorGroups: it is possible to save all open tabs as a captor group. Then close all tabs, and reopen the captor group with again all those tabs opben. Captor Groups is also a simple textfile in the same style of above mentioned last.dat ... But with CaptorGroups it's not only possible to open the entire bunch of urls all at once, but it is also possible to select each single url out of any group to open it separately.

So normal working is: clearing "last.dat" by renaming it by a date or a topic and start from scratch; then open a relevant url (newspaper etc.), go through tha main page and open every interesting article in a new tab. That opens some 20 urls. Then it's time to read the opened articles, and some them have other links to open. It's easy to have open some 40 tabs. At a certain moment either all the tabs can be stored in a CaptorGroup, or NC can be quit. Before restarting, the last.dat can be renamed for having a brand new empty tab and saving all the urls separately. NC recreates a new last.dat when openig it again. But it's also possible to rename an old last.dat or copy some (or all) urls into current last.dat ... numbering of the urls are not relevant; they are just opened in the order of the lines.

Would be gread if KM would be as simple as NC for saving tab lists ... grinning smiley

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: siria
Date: January 27, 2016 08:27PM

Since about 6-8 weeks am working really hard on my tablistia macro, will go crazy if that thing won't be finished SOON, argh!!! The prob were the huge chunks of javascript that it needs, and some html-coding and css-coding, and of all 3 have only tiny bits tourist knowledge. But works now, the remaining stuff is just adding more gimmicks and improve user interface.

Although it's not fully what you want, because it's not collecting automatic during a session. Only stores a session or a window when a user calls it MANUALLY. It stores titles and URLs in a simple html file, which can be shown in browser as list, with clickable links and checkboxes. For editing those files can also be opened in a text editor, although the source code contains a bit html coding stuff of course. As gimmick it can already import older, native KM sessions as a new list (but not EX-port into the native sessions system, only store a 1-session-list as a single file). Would you have suspected that the native KM-sessions plugin actually stores all the titles too?? Was quite a surprise to discover this smiling smiley Well and so far tablistia can only import from the old sessions in prefs.js, but modern sessions.json will follow some time later. At the moment busy with getting sessions from other profiles list-able too.

But suppose the live-collecting is a major point for you. James has a similar macro that does this, called "groups2"!
Haven't tried it yet, only took a look at the code, but in general am not quite sure how reliable the live-collecting works in KM. Because I wanted to do it with tablistia too, and the same way as groups2, because there really seems no alternative. But it's rather tricky in KM, and had the impression the last 1-2 tabs tend to fall under the table sometimes, so finally decided to drop that function again - for now.



Edited 1 time(s). Last edit at 01/27/2016 08:34PM by siria.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: JamesD
Date: January 28, 2016 06:13PM

Groups2 can grab all the currently open tabs. A click on "Groups" on the main menu and select "Save a group" will allow the user to input a name [ which could be just a number] and it is saved.

See info on my macros about tabs as well as others here:
http://kmeleonbrowser.org/forum/read.php?9,137101

Just to note, Groups2 is user initiated, PriorTabs is real time, and LastTabs requires a clean shutdown.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: siria
Date: January 28, 2016 07:07PM

Oops, must have confused the live-collector with LastTabs, sorry.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: JamesD
Date: January 29, 2016 01:34PM

siria

LastTabs collects all tabs as they are closed. Since I only wanted the tabs that close at shutdown, I clear the data on certain other events. If I have an Onload or an OnActivateWindow event then I am not shutting down and all records of previous tab closings are not needed. OnQuit writes the data to a file which is read at the next start of KM and is used in building the menu.. Only those records which happened in the last one or two seconds before OnQuit are included.

Because the tab data is only kept in a variable until KM shuts down and is written to file in the OnQuit event, there must be a clean shutdown to keep the data.

PriorTabs collects tabs as they are closed. Each one is written to an ini file and added to the menu in the OnCloseTab event. The ini file is deleted upon a clean shutdown and upon the next start of KM if there was not a clean shutdown.

In the VIEW menu then there are the following:
Tabs-------- All the currently open tabs. (standard)
Prior tabs-- All the tabs previously closed in the current session. (PriorTabs.kmm)
Last tabs--- All the tabs that were open when KM was last shutdown. (LastTabs.kmm)
Between these items and Groups2, do you think Voltaire has enough functionality to do what he requires or is there some other macro needed?

Voltaire

Please feel free ask if you need some other method.

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: Voltaire
Date: January 29, 2016 10:52PM

Please give me some time to check the behaviour ... smiling smiley

What are possible criteria for an event that can save the tab list?

Options: ReplyQuote
Re: How to get opened last open tabs if ...
Posted by: JamesD
Date: January 30, 2016 03:24PM

Quote
Voltaire
What are possible criteria for an event that can save the tab list?

The only two methods for saving the current tab list are Sessions and Groups. Both Sessions and Groups are user initiated and Sessions also is event driven by OnQuit, I think. A clean shutdown saves the session.

In the menu system the item "@TabList" is called to display the current tabs. It is an 'in memory' item and I do not know of a way to use it other than to display the tabs in a menu.

For the Groups system, I had to change to every window and every tab in each window to obtain the same information.

Do you need to capture the tabs based on elapsed time or number of tabs or some other basis?

A listing of events can be seen here:
http://kmeleonbrowser.org/wiki/MacroLanguage2#events

A listing of predefined global variables can be seen here:
http://kmeleonbrowser.org/wiki/MacroLanguage2#global

Options: ReplyQuote


K-Meleon forum is powered by Phorum.