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

Support and discussions for the x86/x64 Linux version of Pale Moon and specific Linux distribution questions related to the browser.

Moderator: trava90

Forum rules
If your question is about general use of the browser and not specific to Linux, then please use the General Support board.
Post Reply
eater
Hobby Astronomer
Hobby Astronomer
Posts: 25
Joined: 2017-05-13, 21:31

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

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?

User avatar
The Squash
Fanatic
Fanatic
Posts: 167
Joined: 2020-03-25, 19:31
Location: As far from you as possible!

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

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.
 */
UNIX VERSUS MS-DOS
THE EPOCH SHOWDOWN

ONE IS STUCK IN 1970. THE OTHER IS STUCK IN 1980. WHO WILL SURVIVE?

"One's disco era. One's funk era. Who do you think's going to win?" -- The New Porker
IN THEATERS NOW
Rated PG -- for some violent action.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 28139
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

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

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.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image


User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 28139
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

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

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.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

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

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: 28139
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

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

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.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

User avatar
The Squash
Fanatic
Fanatic
Posts: 167
Joined: 2020-03-25, 19:31
Location: As far from you as possible!

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

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?
UNIX VERSUS MS-DOS
THE EPOCH SHOWDOWN

ONE IS STUCK IN 1970. THE OTHER IS STUCK IN 1980. WHO WILL SURVIVE?

"One's disco era. One's funk era. Who do you think's going to win?" -- The New Porker
IN THEATERS NOW
Rated PG -- for some violent action.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 28139
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

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

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.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 295
Joined: 2017-04-20, 21:25
Contact:

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

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.

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

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

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"?

Post Reply