Each new window as independent process

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.
User avatar
Alexei
Newbie
Newbie
Posts: 3
Joined: 2021-06-23, 12:16

Each new window as independent process

Unread post by Alexei » 2021-06-23, 13:38

It's my 1st post on this forum, though I'm using Pale Moon for quite a while.
I noticed Pale Moon from time to time becomes almost unresponsive - something takes 100% CPU and it's likely ralated to the particular page (I open each page in a new window).
I understand, it may be very hard to implement reliable protection against such situations. I think it would be nice to be able to open new window, as an independent instance (separate process). It may be "Open Link in New Instance" or something like that. I mean additional right-click option similar to "Open Link in New Private Window".
I think, such feature would provide additional security because opened web pages could be fully independent, as well as improved stability because crash of independent window would not affect other pages. Also, on each window it would be nice to have "Terminate and Reload" and "Terminate and Close" to deal with hang-issues.
BTW, Pale Moon is :thumbup:
Last edited by Moonchild on 2021-06-23, 13:48, edited 1 time in total.
Reason: BTW "PaleMoon" -> "Pale Moon"

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

Re: Each new window as independent process

Unread post by Moonchild » 2021-06-23, 13:52

This can't be done. The only way you can have multiple processes is in the way Google and Mozilla have done it, with electrolysis (e10s), which we explicitly don't support due to the many, many pitfalls, security issues and the resource handling nightmare it causes.
Just "launching another process" for a new window in our current state doesn't work because it can't use the same profile from multiple processes concurrently.

By the way, other browsers' multi-process approach doesn't actually stop non-responsiveness; it only masks it from the user. But if something really hangs, then yes, it will also affect the UI even in Chrome or Firefox; often in a more severe way at that (no watchdog pop-up or what not allowing you to stop bad scripting).

However, if you have any good ideas about how to approach this in a way that avoids concurrent profile access issues and doesn't use IPC/e10s I'd love to hear them.
"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

User avatar
Nuck-TH
Project Contributor
Project Contributor
Posts: 195
Joined: 2020-03-02, 16:04

Re: Each new window as independent process

Unread post by Nuck-TH » 2021-06-23, 15:29

While we are at it: can chrome and content execution and compilation of JS be separated into different threads? Or it is not only cause of UI lockups? I don't have any real knowledge of how it works in UXP, so I'm really curious. :oops:

IMHO long lockups are not really a problem(since they are rare) and timeout dialog is really useful(as it is usually scripts that not take long, but that really hit infinite loop), but small hiccups are - they severely damage usability by locking UI, messing up scroll, missing input, etc. And as bad masking as it fundamentally is, but it mitigates hiccups well.

New Tobin Paradigm

Re: Each new window as independent process

Unread post by New Tobin Paradigm » 2021-06-23, 15:47

Improving multi-threading IS among our goals. Ideally most operations that could become ridiculous would be off the main thread. We have a decent degree of this already but as people have noticed sometimes the UI freezes from time to time. So we basically still have work to do on that front.

However, you can't think of multi-threading as strictly following the same model as how Mozilla did e10s. For one, it has to actually make sense and there wouldn't be the kind of duplication and redundancy involved in multi-process.

User avatar
Alexei
Newbie
Newbie
Posts: 3
Joined: 2021-06-23, 12:16

Re: Each new window as independent process

Unread post by Alexei » 2021-07-03, 13:11

@Moonchild
I think I have a workable idea of how to implement it with minimal efforts.
1) Allow users adding custom choices to Open Link menu.
Properties: Name, Command to invoke (with %url%), create standalone/child process (and maybe something else).
2) Add PaleMoon command line parameter: "limited functionality" (or something like that), this parameter would disallow changes to the PaleMoon files, which cannot be shared. Another parameter would apply config updates from specified file.

How it's supposed to work:
User's choice starts a script that copies core files to a temporary subdirectory (and/or creates hardlinks to them), creates configuration files in it, and starts the new PaleMoon instance in standlone mode. It could be a standard script (provided by PaleMoon) or written by user (for ex. to open link in another browser, download with Curl, etc.).

I believe such approach (using script to provide new functionality) brings a lot of flexibilty and, most importantly, does not increase complexity of the main application (in my view, overintegration is what modern software suffers from).

User avatar
Nuck-TH
Project Contributor
Project Contributor
Posts: 195
Joined: 2020-03-02, 16:04

Re: Each new window as independent process

Unread post by Nuck-TH » 2021-07-03, 13:48

"Read only part" wouldn't function normaly as at least cookies are always need to be written. If such instance needs to be "new window" then lack of synchronization in places(history, bookmarks, etc...) and settings will create huge UX inconsistency.
If that new instance is not read only, then how do you sync all above stuff? If some sync module will need to be written, then consider that conflicting changes are not automatically mergeable.
Next option is inter-process communication... and here we are almost at how Firefox works. Iwouldn't even begin on ow much problems and security issues it caused there.

If easy ideas was a way - they would have been proposed or implemented at some point. But it isn't that easy.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Each new window as independent process

Unread post by moonbat » 2021-07-05, 00:35

Just stick to Firefox instead :roll:
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Each new window as independent process

Unread post by Moonchild » 2021-07-05, 01:27

Alexei wrote:
2021-07-03, 13:11
I think I have a workable idea of how to implement it with minimal efforts.
I'm afraid not.
The "minimal effort" part would be if this was done in a dirty hack way. But if something like that would be done properly, then one needs to think about things like:
  • How would you distinguish a "limited functionality" window from a "regular" window? The user needs to know this, visually.
  • How would you handle the case if a user decides they want to have data from this "limited" window saved, anyway? Because that's inevitably going to happen.
  • How would you handle the copying of files from a profile that is locked by the main process? Keep in mind there are databases in use here that are locked and cannot be copied in an open state -- this is why you MUST shut down the browser if you make a filesystem profile backup, for example...
  • In what way would this kind of limited functionality and "throwaway" window be beneficial to the user aside from private-window-esque behavior (but then even more limited)? Does it outweigh the obvious added complexity?
etc.

So no, there is no simple solution for doing this, and any sort of "make a temp copy then run a new instance" is a massive can of worms. I'm not going to open that.

I suggest you approach this another way. If you have known-bad sites that don't play nice with Pale Moon and you still want to use it without it interfering with the rest of your browsing session, use a separate portable instance of the browser (e.g. by placing a shortcut to it on your desktop).
"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

User avatar
Alexei
Newbie
Newbie
Posts: 3
Joined: 2021-06-23, 12:16

Re: Each new window as independent process

Unread post by Alexei » 2021-07-15, 15:05

moonbat wrote:
2021-07-05, 00:35
If you have known-bad sites that don't play nice with Pale Moon and you still want to use it without it interfering with the rest of your browsing session, use a separate portable instance of the browser (e.g. by placing a shortcut to it on your desktop).
Basically, that's what I want automated :) I mean automatic creation of new temporary portable instance and opening it with the link, which was clicked. You don't expect me to make such instance manually, right?
Actually, everything can be implemented with some simple scripts.
1. To be invoked at PaleMoon startup to save user preferences (if user's DB cannot provide shared access).
2. To be invoked when user chooses "Open in new instance".
3. To be invoked at instance termination.
Of course, it should be possible to add custom entry to right-click menu.
I'm not sure how you handle bookmarks, but PaleMoon already can import bookmars, so adding bookmarks from another instance shouldn't be a problem.

New Tobin Paradigm

Re: Each new window as independent process

Unread post by New Tobin Paradigm » 2021-07-15, 15:20

RESOLVED INVALID

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

Re: Each new window as independent process

Unread post by Moonchild » 2021-07-15, 20:45

New Tobin Paradigm wrote:
2021-07-15, 15:20
RESOLVED INVALID
To put this in context: that would definitely not be something the browser itself would have to be tasked to do.
viewtopic.php?f=5&t=5647
Point 1, actually. At the very top of the list. For a reason.
"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

Locked