Alert and onbeforeunload dialogs on some "about:" pages still moves tabs to the foreground

RESOLVED INVALID

Status

()

Firefox
Untriaged
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: arni2033, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
>>>   My Info:   Win7_64, Nightly 46, 32bit, ID 20151223030323
STR:
 (A) - alerts
1. Open "about:newtab" in a new tab
2. Open devtools -> Console, type there "setTimeout(_=>alert(2),4000)", press Enter
3. Close devtools, Open new tab (you must perform this step in less than 4 seconds)
4. Wait 4 seconds

 (B) - onbeforeunload dialog
1. Open "about:newtab" in a new tab
2. Open devtools -> Console, type there "onbeforeunload=_=>1", press Enter
3. Close devtools, Click on page content, Open new tab
4. Middle-click the tab from Step 2

Result:       Tab from Step 2 becomes active
Expectations: Tab from Step 2 should stay a background tab

This definitely happens, but I'm not sure if it should be "Wontfix" or "New". So leaving Unconfirmed

> Complete list of affected "about:" pages:   ["about:", "about:about", "about:accounts", "about:addons", "about:config", "about:crashes", "about:credits", "about:customizing", "about:debugging", "about:downloads", "about:healthreport", "about:memory", "about:networking", "about:newtab", "about:plugins", "about:preferences", "about:privatebrowsing", "about:remote-newtab", "about:serviceworkers", "about:sessionrestore", "about:stylish-edit", "about:support", "about:sync-tabs", "about:tabgroups", "about:telemetry", "about:webrtc", "about:welcomeback"]

Comment 1

3 years ago
Why "Tab from Step 2 should stay a background tab"? It have a "onbeforeunload".

https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
(Reporter)

Comment 2

3 years ago
(In reply to YF (Yang) from comment #1)
> Why "Tab from Step 2 should stay a background tab"? It have a "onbeforeunload".
According to the work made in bug 332195. You can try it right now on normal pages.
However, scenario (B) will become invalid if in bug 1234936 the old behavior will be restored.

Comment 3

3 years ago
This is the expected outcome of bug 332195, because it's not really sensibly possible to build a whitelist of about: pages today, and because about: pages are generally trusted not to abuse modal dialogs, and, to the best of my knowledge, don't. Our bugzilla instance doesn't have "NOTABUG", and the closest is "INVALID", so that's what I'm going to resolve this to.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
(Reporter)

Comment 4

3 years ago
(In reply to :Gijs Kruitbosch from comment #3)
> about: pages are generally trusted not to abuse modal dialogs
Just for the record, "about:" pages listed in bug 1235709 do NOT have the permission to focus the tab with onbeforeunload/alert dialogs. All this is very unclear, so I filed this bug. Here's the list:
> ["about:buildconfig", "about:cache", "about:home", "about:license", "about:logo", "about:mozilla", "about:rights", "about:robots", "about:sync-log"]

Comment 5

3 years ago
(In reply to arni2033 from comment #4)
> (In reply to :Gijs Kruitbosch from comment #3)
> > about: pages are generally trusted not to abuse modal dialogs
> Just for the record, "about:" pages listed in bug 1235709 do NOT have the
> permission to focus the tab with onbeforeunload/alert dialogs. All this is
> very unclear, so I filed this bug. Here's the list:
> > ["about:buildconfig", "about:cache", "about:home", "about:license", "about:logo", "about:mozilla", "about:rights", "about:robots", "about:sync-log"]

Correct. It's based on whether the pages have system privileges. All of these pages are unprivileged.

Comment 6

3 years ago
(FWIW, it seems like at least about:credits is in the wrong list here - I don't see a tabswitch happening from there, which makes sense because it isn't privileged. I haven't checked all of the rest of your lists.)
(Reporter)

Updated

3 years ago
Has STR: --- → yes
You need to log in before you can comment on or make changes to this bug.