min
min copied to clipboard
Prompt() actions on websites lead to unexpected and silent failures
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
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?
It's a page behind a login with payment processor Paddle, so there's no direct way to access it.
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).
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...
May be is there way to use something like this? https://github.com/pconerly/electron-prompt/blob/master/prompt.js