alert, confirm, prompt shouldn't steal focus

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.
jangdonggun1234
Fanatic
Fanatic
Posts: 104
Joined: 2013-06-06, 01:29

alert, confirm, prompt shouldn't steal focus

Unread post by jangdonggun1234 » 2014-11-24, 08:03

Hi Moonchild, according to https://bugzilla.mozilla.org/show_bug.cgi?id=332195
I think better if Palemoon fix that annoying feature/bug, it is really annoying and redundant, why on earth people have to switch to tab that call alert, confirm, prompt when he is reading another tab just by a setTimeout call these function, ridiculous.. Especially people with about 2000 tabs open(2000 is normal state, sometimes I opened about 5000-7000tabs), hard to find thier previous tab again for sure, like me is an big example.

I have to agree that alert, confirm, prompt is really useful feature, override it with custom div style dialog never match, still so much cons vs those three. The only annoying is that it cannot auto close or it steal user focus from another tab, better if Palemoon do that first!

I know that it break feature like onunload, but it is just a super small deal, nothing more than that, cannot harm user and almost 99% site use onunload I just something like prevent user close tab or prevent them from forgetting save their post..

Thank! I think better if Palemoon get rid of these redundancy, even Firefox didn't.

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

Re: alert, confirm, prompt shouldn't steal focus

Unread post by Moonchild » 2014-11-24, 11:46

It's not redundant behavior at all.

If a web page throws up an alert, input, confirm, etc. prompt, it requires your action. As such, your attention should be called to it. Your suggestion of a blinking/colored tab won't help because your tab with the prompt will not be in view and you will never see it.

With tab-modal dialogs you are free to return to your previous tab and leave it for later if you so choose but not alerting the user at all is not a good thing.

(By the way, awesome you can open that many tabs in Pale Moon! It's certainly not within the designed specifications to handle that many 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

jangdonggun1234
Fanatic
Fanatic
Posts: 104
Joined: 2013-06-06, 01:29

Re: alert, confirm, prompt shouldn't steal focus

Unread post by jangdonggun1234 » 2014-11-24, 12:12

Moonchild wrote:It's not redundant behavior at all.

If a web page throws up an alert, input, confirm, etc. prompt, it requires your action. As such, your attention should be called to it. Your suggestion of a blinking/colored tab won't help because your tab with the prompt will not be in view and you will never see it.

With tab-modal dialogs you are free to return to your previous tab and leave it for later if you so choose but not alerting the user at all is not a good thing.

(By the way, awesome you can open that many tabs in Pale Moon! It's certainly not within the designed specifications to handle that many tabs ;) )
I cannot agree at all because you know, alert, confirm or prompt pause all javascript from that tab so it is ok to leave things like that, it disturb user more than it help.

Can you implement a config to toggle on/off that feature ? I tried to override those three using Javascript but it is not perfect at all, it still cause so much problem about callback function, cannot have perfect callback like those three.

Yeah, once it jump I don't know how to get my old tab back..

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

Re: alert, confirm, prompt shouldn't steal focus

Unread post by Moonchild » 2014-11-24, 12:50

No, the problem is, specifically, that the prompt pauses script execution on the affected tab. There are many dynamic sites that will break if a prompt is let sit because scripts and requests time out (e.g. socket connections, queries, etc.). Not to mention background XHR and AJAX requests that are also stopped. Just "pausing indefinitely by having a prompt" is often a bad thing.

So in general it does need your attention within a reasonable amount of time to not break the site.

On the other hand, I understand your specific issue with a combination of many similar tabs and delayed modal prompts on background sites. Also, it would be a good idea to give users the option to reduce control of page content over browser operation if desired (in line with the previous autocomplete= change for passwords)

It's possible to put the DOM window event (that would switch the focus) behind a pref, which would likely solve your issue (would need some testing to verify).
Focus switching would still be allowed by default since that is generally the desired behavior.
"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

jangdonggun1234
Fanatic
Fanatic
Posts: 104
Joined: 2013-06-06, 01:29

Re: alert, confirm, prompt shouldn't steal focus

Unread post by jangdonggun1234 » 2014-11-24, 12:53

Moderator note: redundant quote removed.

Thank you very much, hope you can implement that feature next verison!

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

Re: alert, confirm, prompt shouldn't steal focus

Unread post by Moonchild » 2014-11-24, 13:09

A tip for future posting on this forum: PLEASE do not quote the entire previous post. Only quote what is relevant, if anything. It's pointless to have a copy of the post that is right above it already
"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