"What should Pale Moon do with this file?" box very slow

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
eater
Hobby Astronomer
Hobby Astronomer
Posts: 25
Joined: 2017-05-13, 21:31

"What should Pale Moon do with this file?" box very slow

Unread post by eater » 2020-08-23, 15:49

When I click to download a file, I get the little dialog box offering to open or save the download. But the "OK" button at the bottom of the dialog box is greyed out, and typically stays greyed out for several seconds, then becomes clickable. (It doesn't seem to have anything to do with the progress of the download.)

If I unfocus the Pale Moon window (by moving my mouse off it) and then re-focus it, the button greys out for another several seconds before it becomes clickable.

Mild annoyance but I wonder if it's fixable?

The Squash

Re: "What should Pale Moon do with this file?" box very slow

Unread post by The Squash » 2020-08-23, 15:59

On all the Pale Moon versions I've tried since 2017, I've always seen that effect too. For me, it's an extemely precise 1 second delay. The same thing happens to the "Reload" button in the browser, which also stays grayed out for a second.

I've never figured out what caused this, though.

If I had to guess though, it's probably one of the lines in the code that looks like this:

Code: Select all

/*
 * A race condition may ensue if we allow a download to be saved immediately.
 * The file chooser dialog uses the handle of the input stream as soon as the
 * dialog is opened; this means the handle may not yet be valid.  See bug
 * 1234567.
 */

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

Re: "What should Pale Moon do with this file?" box very slow

Unread post by Moonchild » 2020-08-23, 16:44

This delay is on purpose. It is a security measure to prevent scripted events from "clicking" the OK button for you or tricking the user into having a queued up keypress causing the download (or worse: opening) of the file, and is avoiding drive-by downloads this way. You should be able to make it active by clicking elsewhere on the window yourself registering actual user interaction.
"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
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35402
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: "What should Pale Moon do with this file?" box very slow

Unread post by Moonchild » 2020-08-23, 16:50

I don't recommend removing the delay. I've actually seen the malicious trick being used in the wild on some sites.
"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

eater
Hobby Astronomer
Hobby Astronomer
Posts: 25
Joined: 2017-05-13, 21:31

Re: "What should Pale Moon do with this file?" box very slow

Unread post by eater » 2020-08-23, 17:19

Moonchild wrote:
2020-08-23, 16:44
This delay is on purpose. It is a security measure to prevent scripted events from "clicking" the OK button for you or tricking the user into having a queued up keypress causing the download (or worse: opening) of the file, and is avoiding drive-by downloads this way. You should be able to make it active by clicking elsewhere on the window yourself registering actual user interaction.
Good to know, thanks! Clicking elsewhere in the dialog box doesn't make it active for me, I still have to wait.

But now that I know it's intentional and for my own good, I will wait contently.

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

Re: "What should Pale Moon do with this file?" box very slow

Unread post by Moonchild » 2020-08-23, 19:58

eater wrote:
2020-08-23, 17:19
Clicking elsewhere in the dialog box doesn't make it active for me, I still have to wait.
I was pretty sure that would free it up but maybe I misremember. And maybe it's been changed by Mozilla since I last checked, too.
"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

The Squash

Re: "What should Pale Moon do with this file?" box very slow

Unread post by The Squash » 2020-09-09, 01:18

Moonchild wrote:
2020-08-23, 16:50
I've actually seen the malicious trick being used in the wild on some sites.
I've programmed a lot of JavaScript in the past, and I truly wonder: How the heck does that attack even work? How does JavaScript code synthesize a keypress or click event like that?

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

Re: "What should Pale Moon do with this file?" box very slow

Unread post by Moonchild » 2020-09-09, 04:35

The Squash wrote:
2020-09-09, 01:18
Moonchild wrote:
2020-08-23, 16:50
I've actually seen the malicious trick being used in the wild on some sites.
I've programmed a lot of JavaScript in the past, and I truly wonder: How the heck does that attack even work? How does JavaScript code synthesize a keypress or click event like that?
I'm sure you can find examples if you only search for it.
"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
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25
Contact:

Re: "What should Pale Moon do with this file?" box very slow

Unread post by Lunokhod » 2020-09-11, 02:23

Off-topic:
How does JavaScript code synthesize a keypress or click event like that?
https://mdn.github.io/dom-examples/pointer-lock/
http://media.tojicode.com/q3bsp/
Those demos show mouse movement, which isn't exactly the same, but I saw a page once where the mouse moved under the webpage's control, and that seems how it might be done, by creating a replacement mouse image and hiding the original. Click on the active area, and press escape to get your mouse back. It would be useful for 360 VR videos if they were controlled like that, better than click and drag! Especially fun with a trackpoint.
Wait, it's all Ohio? Always has been...

User avatar
therube
Board Warrior
Board Warrior
Posts: 1648
Joined: 2018-06-08, 17:02

Re: "What should Pale Moon do with this file?" box very slow

Unread post by therube » 2020-09-11, 19:34

Aside from "automated" attack, the general response to a popup (to any popup), is to "click it".
So an automatic delay (which AFAIK) has always been the case (on Mozilla browsers), makes, or at least entices one to stop & think, for a moment, "do I want to actually do this"?

Locked