New issue
Advanced search Search tips

Issue 672573 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Dec 2016
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

JS dialogs don't auto dismiss in a non-foremost tab, and steal focus

Project Member Reported by hwi@chromium.org, Dec 8 2016

Issue description

Chrome Version: 57.0.2936.0
OS: Windows, OSX

What steps will reproduce the problem?
(1) open two windows and/or two tabs
(2) open goto.google.com/dtjs on one of the windows/tabs
(3) click "Try it" from the page
(4) immediately move focus to another window/tab to make the page in 3 non-foremost
(5) a few seconds later, the tab with 3 is auto focused
(6) when clicked another tab, the dialog is auto-dismissed, and a second later the tab with 3 is auto focused again (this will be repeated for 8 times with the test page). Auto-focusing happens for both a hidden-tab and a visible but not foremost tab. 

What is the expected result?

Dialogs on the non-foremost tab should be auto dismissed according to the doc "[Non-Foremost Tabs
] For confirm and prompt dialogs, we would immediately return false/null to prevent the JavaScript from blocking".

What happens instead?

Both on a hidden-tab and on a non-foremost&visible tab, js dialogs open and also are auto-focused.

Screen recordings:
https://drive.google.com/open?id=0B63LqjsMmAX_ZWh0bXB0dGZWdVE
https://drive.google.com/open?id=0B63LqjsMmAX_MWJueGI4YmlFVTA
https://drive.google.com/open?id=0B63LqjsMmAX_SVVqLWJMWTlDVTQ

 
Status: Assigned (was: Unconfirmed)

Comment 2 by a...@chromium.org, Dec 9 2016

Status: WontFix (was: Assigned)
This is intentional for now.

I would like to make alert() and confirm() dialogs not steal focus, but I have to collect metrics and coordinate with the web platform team to do it right. It's going to be a bit of a slow go to make sure everyone gets happy, but as these are really old web APIs, I have to do it right.

On a happier note, this doesn't happen with prompt() any more! I got consensus with the web people (see the Intent at https://groups.google.com/a/chromium.org/d/msg/blink-dev/HzB7moqAZG0/alJ5eSSqAQAJ ) and it's gone.

Sign in to add a comment