alert, prompt, confirm don't work inside the viewport

VERIFIED FIXED in Firefox 66

Status

defect
P3
normal
VERIFIED FIXED
3 years ago
3 months ago

People

(Reporter: jryans, Assigned: pbro)

Tracking

unspecified
Firefox 66
Dependency tree / graph

Firefox Tracking Flags

(firefox66 verified)

Details

(Whiteboard: [multiviewport][reserve-rdm][dt-q])

User Story

`window.alert()` fails inside the viewport, nothing happens:

- data:text/html,<script>onclick=function(){alert('ok')}</script>
  I think it relates to mozbrowsershowmodalprompt

`prompt` and `confirm` have similar issues.

Attachments

(1 attachment)

Comment hidden (obsolete)
(Reporter)

Comment 1

3 years ago
(Copied from :ochameau's review of bug 1240913.)
Flags: qe-verify?
(Reporter)

Updated

3 years ago
Flags: qe-verify? → qe-verify+
QA Contact: mihai.boldan
Just a remark regarding this issue: once you opened the RDM once in a tab's lifetime, window.alert()/window.open() won't work anymore, even if you close the RDM, reload the page, or change the URL.
(Reporter)

Updated

3 years ago
Blocks: 1296498
Priority: P3 → P2
(Reporter)

Comment 3

3 years ago
I've started to look at this one locally, so I'll grab it for now.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Iteration: --- → 51.2 - Aug 29
Priority: P2 → P1
Iteration: 51.2 - Aug 29 → 51.3 - Sep 12
(Reporter)

Updated

3 years ago
See Also: → 1300214
(Reporter)

Comment 4

3 years ago
I think part Benoit mentions in comment 2 is the more serious problem, since we're messing up the tab even after RDM is closed.  I'll break that out to a separate bug.  (It appears only the window.alert is impacted this way.  window.open does work once you closed RDM.)

I created bug 1300214 for that portion.  Furthermore, I think that's the only piece we really need before enabling in Nightly, so I'll move this back to reserve.
Assignee: jryans → nobody
Status: ASSIGNED → NEW
Priority: P1 → P3
(Reporter)

Updated

3 years ago
No longer blocks: 1296498
Iteration: 51.3 - Sep 12 → ---
(Reporter)

Updated

3 years ago
Blocks: rdm-top
(Reporter)

Comment 5

3 years ago
I am working on the window.open() portion in bug 1310851.
Summary: window.open, alert don't work inside the viewport → window.alert doesn't work inside the viewport
(Reporter)

Updated

3 years ago
User Story: (updated)
(Reporter)

Updated

2 years ago
Duplicate of this bug: 1336435

Comment 7

2 years ago
Also affects window.prompt, but you probably already knew that.
(Reporter)

Updated

2 years ago
Duplicate of this bug: 1383468
(Reporter)

Updated

a year ago
Duplicate of this bug: 1428096

Comment 10

a year ago
.. and confirm() too  (ran into this on a form confirming a db modification while trying to test throttling - apparently bug #1349559 will let me avoid this problem)

Comment 11

a year ago
I just ran across the issue with alert not working in responsive design mode.  It seems that this is still an open bug.  Or is it a settings issue?  Please advise.
(Reporter)

Updated

a year ago
User Story: (updated)
Summary: window.alert doesn't work inside the viewport → alert, prompt, confirm don't work inside the viewport
(Reporter)

Updated

a year ago
Duplicate of this bug: 1453889

Comment 13

11 months ago
Still an issue in 59.0.3.

Updated

10 months ago
Product: Firefox → DevTools

Comment 14

9 months ago
I'm at 61.0.1 and the problem still there.

Comment 15

9 months ago
window.open() won't return window reference as well

Comment 16

9 months ago
I think this should have a higher priority since it seems it is affecting a lot of developers using the RDM.
(Reporter)

Updated

7 months ago
Duplicate of this bug: 1487037
Duplicate of this bug: 1492722
Whiteboard: [multiviewport][reserve-rdm] → [multiviewport][reserve-rdm][dt-q]
(Reporter)

Updated

7 months ago
Duplicate of this bug: 1495407

Comment 20

5 months ago
I would like to add that this should be considered a higher priority.

I just spent over an hour debugging code, resetting browser settings to default, disabling plug-ins, and ask co-workers to test a page in their browser. I was using RDM to simulate the screen of a coworker who had a larger display than me, and suddenly our save confirmation prompts stopped working (which made it so modal layers couldn't be closed at all).

I had figured that a recent Firefox update decided to disable them or something (IE disabled prompt() a few years ago) and I was > < this close to creating an emergency porting for all my code.

I had completely forgotten that I was in RDM mode and only when a co-worker mentioned it did I think to close out RDM - and sure enough the code works again.
(Assignee)

Comment 21

5 months ago
With the way RDM works today, this isn't a trivial fix.
I've been looking at the code for this and related comments on this bug, and I do think that support alert() should be quite easy.
Supporting prompt and confirm though seem a lot harder, but it's perhaps because I don't know where to look yet.
It'd be great if the mozbrowser iframe we use could just be allowed to open these prompt dialogs by default. And it's probably the right fix.
In the meantime, listening to mozbrowsershowmodalprompt events will make it possible to relay alerts through the outer browser, but sending back the return value of confirm/prompt calls seems trickier.

If we can't do them quickly, we should at least make sure users understand that they're not supported. Many people have lost hours just wondering why their code wasn't working, when really RDM was just silently swallowing the alert/confirm/prompt dialogs.

So I would suggest implementing a fix for alerts, and warning users for prompt/confirm for the time being.
And in the meantime, starting the investigation on the platform side, to allow mozbrowser iframes to do all 3 types of prompts.
(Assignee)

Comment 23

5 months ago
Comment on attachment 9029624 [details]
Bug 1273997 - Minimap support for alerts in RDM by relaying alerts on outer browser

Hi Ryan, not sure how much time you have these days for Mozilla-stuff, but in case you have a few minutes to spare, what do you think of this (see comment 21 for the rationale behind this)?
Attachment #9029624 - Flags: feedback?(jryans)

Comment 24

5 months ago
Thank you. I understand the fix may not be trivial, but at the very least a warning message in the console that messages are being suppressed due to RDM would be a huge time saver.
(Assignee)

Comment 25

5 months ago
Comment on attachment 9029624 [details]
Bug 1273997 - Minimap support for alerts in RDM by relaying alerts on outer browser

Let me drop this attachment as it turned out to be much easier than I thought to support comfirm/prompt too, since we have all the APIs we need thanks to BrowserElementPromptService.
Thank you Ryan for your guidance on IRC yesterday.
Attachment #9029624 - Attachment is obsolete: true
Attachment #9029624 - Flags: feedback?(jryans)
Attachment #9029624 - Attachment is obsolete: false
(Reporter)

Comment 26

5 months ago
Seems like a reasonable approach to me.  Sorry this area is so painful...
(Assignee)

Updated

4 months ago
Assignee: nobody → pbrosset
Status: NEW → ASSIGNED

Comment 27

4 months ago
Pushed by pbrosset@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/95e9c87e234b
Minimap support for alerts in RDM by relaying alerts on outer browser r=ochameau,jryans

Comment 28

4 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/95e9c87e234b
Status: ASSIGNED → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66

Verified Fixed on latest Nightly 66.0a1 (2019-01-10) (64-bit) on Windows 10, Ubuntu 16.04 and Mac OS 10.13.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Updated

3 months ago
Duplicate of this bug: 1524044
You need to log in before you can comment on or make changes to this bug.