min icon indicating copy to clipboard operation
min copied to clipboard

Prompt() actions on websites lead to unexpected and silent failures

Open CLBarajas opened this issue 4 years ago • 5 comments

First, I know - it's unsupported in electron (electron/electron#472), but I feel like I have to mention this because a problem like this causes Min to fail the functionality of an all-purpose browser.

  • Min Version: 1.15.0
  • Operating system: macOS 10.15.6

Expected Behavior

Prompt dialog is displayed and interactive, and can be handled before proceeding with other tasks on the website.

Actual Behavior

No prompt dialog, page refreshes with an error.

To Reproduce

Using a payment processing site, I attempted to take an action (forwarding an email), which caused the page to refresh with an error of '' is not a valid email address.

After checking the Console, I was able to spot the error and copy it just before the page refreshed:

16791113:4 Uncaught Error: Uncaught Error: prompt() is and will not be supported.
    at HTMLFormElement.<anonymous> (16791113:129)
    at HTMLFormElement.dispatch (jquery-1.11.1.min.js:3)
    at HTMLFormElement.r.handle (jquery-1.11.1.min.js:3)
    at HTMLFormElement.nrWrapper (16791113:4)
(anonymous) @ 16791113:129
dispatch @ jquery-1.11.1.min.js:3
r.handle @ jquery-1.11.1.min.js:3
nrWrapper @ 16791113:4

CLBarajas avatar Aug 11 '20 02:08 CLBarajas

We have some code to implement a prompt dialog for the password manager already; we might be able to reuse that to reimplement the prompt() method, although I'm not sure if it's possible to block the tab renderer process while the dialog is being shown (which would be necessary to implement this)

Regardless, Chrome's data shows this method being used on around 0.005% of pageloads (https://www.chromestatus.com/metrics/feature/popularity#V8Window_Prompt_Method ) so fixing this is probably a low priority.

Also, what site did this happen on?

PalmerAL avatar Aug 11 '20 06:08 PalmerAL

It's a page behind a login with payment processor Paddle, so there's no direct way to access it.

CLBarajas avatar Aug 11 '20 19:08 CLBarajas

Would it be too bad to just give an actual error message to the user when prompt is called? Something like "This site is using an unsupported method and is prone to errors"? At least it won't be silent anymore and may guide tech-savvy people and site creators to use other methods of user input (e.g: change the site to use a lightbox with a form input).

jackmcmorrow avatar Aug 28 '20 19:08 jackmcmorrow

Still facing this trouble on MacOS. Many websites use native JS prompt and alert functions, and lack of it stop people from making Min primary browser.

Looking forward for solution...

Aleksandr-ru avatar Jun 29 '22 07:06 Aleksandr-ru

May be is there way to use something like this? https://github.com/pconerly/electron-prompt/blob/master/prompt.js

Aleksandr-ru avatar Jan 18 '24 16:01 Aleksandr-ru