Limit the number of concurrently loading tabs

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
jumba

Limit the number of concurrently loading tabs

Unread post by jumba » 2015-11-02, 17:41

I suggest to use the same kind of behaviour that is used when restoring a previous browser session for opening many tabs at once. For example when opening a folder of bookmarks or when opening simultaneously many links.

The loading process could be deferred limiting the number of concurrently loading tabs or by only loading the first few tabs and keep the rest unloaded until activated.

New Tobin Paradigm

Re: Limit the number of concurrently loading tabs

Unread post by New Tobin Paradigm » 2015-11-02, 20:53

Why not just use that pref that says don't load background tabs when restoring a session. Also, isn't that already default?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Limit the number of concurrently loading tabs

Unread post by Moonchild » 2015-11-02, 20:55

1. "Don't load tabs until selected"
2. If not using "1", it will be configurable how many load concurrently (default 3) See: browser.sessionstore.max_concurrent_tabs
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Supernova

Re: Limit the number of concurrently loading tabs

Unread post by Supernova » 2015-11-03, 00:37

Tobin & MC : you adress the restore session case, don't you ?
Because as I understood it, it's just an example of the behavior jumba would like to be able to get in other circumstances.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Limit the number of concurrently loading tabs

Unread post by Moonchild » 2015-11-03, 00:54

You're right, I didn't read carefully.

I'm... also not entirely sure how this could be implemented in a sane way and whatever it is it would be quite complex under the hood. When you have a session restoration, it's easy to know what needs to be done and can simply be queued up sequentially; in the case of opening links, it's not. After all, I assume these many links would be opened while the user continues to interact with the browser, probably multiple tabs. The session would be in active use and not a straight-up queue. Plenty of behavior needs to be taken into account and would need prioritization. It'd probably be a lot more complex and error-prone than just being patient for a couple of seconds when opening many tabs at once.

Also, background tabs would not get the same priority for resources already, so at most it would help with network congestion.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

jumba

Re: Limit the number of concurrently loading tabs

Unread post by jumba » 2015-11-03, 08:33

Thanks MC for your reply. I have two examples where I think this would be ideal.

The first case is when opening a folder of bookmarks containing a number of n bookmarks. The process is similar to a session restore (kind of), let's just assume the "folder of bookmarks" is a "session". When the folder is opened, the n bookmarks are opened to new tabs. This is similar what happens when restoring a previous session, and where, instead of loading all the n tabs at once, concurrently loading tabs are limited or alternatively the tabs are loaded only after switching to them.

The second case is when processing multiple pages by opening multiple links on a same site. For example this could happen when the user needs to modify content of multiple pages on a wiki or a CMS. In the example the user could first opens all the n links to new tabs before beginning to process the pages one by one. If the number of opened links is high it could make the browser slow to react to user actions or make the server slow to respond to the multiple requests of a same user. Result of this could be that the user must wait before the majority of the opened tabs are ready before it is possible to begin the work on the first opened page. Ideally this could work the same way as in the session restoration, so that the concurrently loading tabs are limited.

With these two examples, the concurrently loading tabs limitation could be generalized to all cases consisting of opening of multiple tabs, but under the hood it might not be possible for it's complexity.

Could it be achievable for the first scenario when opening a folder of bookmarks?

In the second case, alternatively it could also help if the links could be opened in background without actually loading them. But I think this is not possible either? A search found this Firefox addon https://addons.mozilla.org/firefox/addo ... ilent-tab/ (FF >= 35.0) and the existence of bugs bug #911427 (a case of opening multiple images in new tabs) and bug #792210 (fix the wording of "Don't load tabs until...").

fillerup

Re: Limit the number of concurrently loading tabs

Unread post by fillerup » 2017-01-21, 11:11

bump. would love a solution for this as well. the most common use for this would be when you open your daily reading list of 15-20 links in a folder bookmark, everything loads at once and grinds the browser to a near halt.

dark_moon

Re: Limit the number of concurrently loading tabs

Unread post by dark_moon » 2017-01-21, 11:21

But the browser do exactly what you want.
If you open 15 (X) bookmarks from a folder, you get of course 15 new tabs (Y).
If you open 20 (X), you get 20 tabs (Y).

So how the browser can know you only want open Y instead of the X sites? Thats ridiculous. But maybe a addon exist which ask you everytime or only load one from X tabs.

See also viewtopic.php?p=69103#p69103

fillerup

Re: Limit the number of concurrently loading tabs

Unread post by fillerup » 2017-01-21, 12:54

dark_moon wrote:See also viewtopic.php?p=69103#p69103
those settings are for session restores only
dark_moon wrote:So how the browser can know you only want open Y instead of the X sites?
hence my question :) since tabs always open in a particular order, is it really that hard to specify the other tabs to not load until the first *insert value here* tabs have completed loading?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Limit the number of concurrently loading tabs

Unread post by Moonchild » 2017-01-21, 13:17

fillerup wrote: is it really that hard to specify the other tabs to not load until the first *insert value here* tabs have completed loading?
Yes it is. See my response above.
e.g. you open 20 tabs, and before the first x number is loaded you click on tab number x+2. What should happen then? Not present anything until the tabs have "caught up"? That's not desirable, so that needs special treatment. What if x number of tabs stall because of slow loading pages? What if you open more tabs while this is in progress?
You can see it gets complicated right quick there.
For session restore this is simpler because it is a single session queue that gets loaded up with either "loaded" or "pending" tabs, and things simply go one direction.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

fillerup

Re: Limit the number of concurrently loading tabs

Unread post by fillerup » 2017-01-21, 13:20

mmm. i guess the question then becomes, how best to minimize the performance impact of having 10+ concurrent loading pages

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Limit the number of concurrently loading tabs

Unread post by Moonchild » 2017-01-21, 13:22

fillerup wrote:mmm. i guess the question then becomes, how best to minimize the performance impact of having 10+ concurrent loading pages
This is already done as best as possible. It's also why the default for automatically loading session restore pages is 3 concurrent pages, not more.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

fillerup

Re: Limit the number of concurrently loading tabs

Unread post by fillerup » 2017-01-21, 13:28

thanks for info. guess i'll work around this by splitting the bookmarks into two folders

HaleSun
Fanatic
Fanatic
Posts: 109
Joined: 2016-03-11, 11:39

Re: Limit the number of concurrently loading tabs

Unread post by HaleSun » 2017-01-21, 16:06

fillerup wrote:bump. would love a solution for this as well. the most common use for this would be when you open your daily reading list of 15-20 links in a folder bookmark, everything loads at once and grinds the browser to a near halt.
The addon "Load Tabs Progressively" did exactly what you want and could limit the number of concurrent tabs loaded from a bookmark folder. Unfortunately it is no longer developed and is not compatible with Pale Moon 27. The new version, "Load Tabs Progressively Fixed" also does not work with Pale Moon but on recent versions of Firefox it is literally the exact solution to this thread. There doesn't seem to be any official means of contacting the current developer (prz) so Pale Moon support is not likely, which is a shame since it is the most elegant solution to this problem of too many concurrently loading tabs I've come across. https://addons.mozilla.org/en-us/firefo ... ely-fixed/
The current behavior in Firefox is as follows:
You can set the max number of concurrent tabs. If you set the max to say 3, problems with stalled or slow loading pages are greatly mitigated since not all loading slots are likely to be stalled at the same time.

Manual actions always have priority. If you open say 20 tabs at once, at any point you can click on any queued tabs that haven't started loading and those tabs will start loading immediately, ignoring the set max concurrent limit.

Likewise, if you open a new tab before all the queued tabs are done, that tab will load immediately as well. If you open another bunch of tabs before the first bunch is done, then the first tab of the new bunch is immediately loaded while the rest are queued.
I do have a somewhat roundabout way of dealing with this issue, which involves two addons:
Open Multiple Locations : https://addons.mozilla.org/en-US/firefo ... locations/
Manage Folders (v1.0.5.1) : https://addons.mozilla.org/en-US/firefo ... d.1-signed

'Manage Folders' allows you to quickly open any bookmark folder in the bookmark manager by right-clicking the folder and selecting "Manage Folder".
Then you press Ctrl-A to select all bookmarks in that folder, and then Ctrl-C to copy the selected bookmark URLs.
Then you paste that list of URLs into the 'Open Multiple Locations' panel and set the desired delay between loading tabs.

Not ideal but at least your browser will still be usable when you initiate 20+ tabs at once.

fillerup

Re: Limit the number of concurrently loading tabs

Unread post by fillerup » 2017-01-22, 05:46

thanks for the writeup! a shame the FF addon no longer works.. will give your solution a try tho it seems a little too convoluted to me