Popunder evasion with spawning from (subsequently-deleted) subframe |
||||||||||
Issue descriptionHere's what I've found out so far. We have a main WebContents, the flight search page. When you fill it in, all of a sudden we get a flash in the lower right corner of the screen. A WebContents is created at this point, and Browser::AddNewContents is called with the |source| being the main flight search page, and |new_contents| being the popup. There is a flash of a dialog appearing and disappearing. From logging we see an instantiation of a guest WebContents, and the PDF viewer URL being loaded into it. I'm assuming the popup on the bottom right of the screen is moved behind the main window because there is no fourth WebContents created. What's interesting is that if I instrument AppModalDialogHelper I see that |dialog_host| is set to the guest WebContents, then |actual_host| is set to the main flight search page, that the |active_web_contents| is set to the popup, but active_web_contents->GetOriginalOpener() is set to null! Yikes! This repros on trunk. RVG because it's being used in the wild.
,
Mar 27 2017
,
Mar 27 2017
Tracking frame owners in FTNs rather than as WCs was https://codereview.chromium.org/1086283002. Approach 1: Using FTNs for "original owner" + Stays parallel to the "owner" implementation + Simpler - The original owner isn't actually a FTN, but a WebContents Approach 2: Using the original approach of keeping a WebContents* in the WebContents + More strictly correct - Two different ways of doing similar things (BTW, the FT remains constant for the WC life, and the root FTN shares the lifetime of the FT so approach 1 can be made correct.)
,
Mar 27 2017
CL up at https://codereview.chromium.org/2773403002 . What is the bar for merging? This probably has been broken for about 1 3/4 years, since the move to FTNs for owner tracking.
,
Mar 27 2017
,
Mar 27 2017
Please have alexmos@ review, since he's very familiar with openers and I'm OOO.
,
Mar 27 2017
Nice analysis, thanks for fixing! The subframe opener tracking definitely made this possible, though it seems that even before that, there might have been holes here until jochen@ introduced original opener tracking in https://codereview.chromium.org/2661403003 a couple of months ago. E.g., AFAICT with old WC-based openers, the popup could still set its window.opener to null, which would've caused the old WCI::DidDisownOpener to clear out WebContentsImpl::opener_, which used to be what AppModalDialogHelper looked at. jochen@'s fix took care of that case, but definitely a d'oh moment for the subframe workaround.
,
Mar 27 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8d1aa16d8f9e854e3f099f9fad9866efe072f821 commit 8d1aa16d8f9e854e3f099f9fad9866efe072f821 Author: avi <avi@chromium.org> Date: Mon Mar 27 18:27:37 2017 Fix popunders spawned from a subframe. BUG= 705316 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2773403002 Cr-Commit-Position: refs/heads/master@{#459835} [modify] https://crrev.com/8d1aa16d8f9e854e3f099f9fad9866efe072f821/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc [add] https://crrev.com/8d1aa16d8f9e854e3f099f9fad9866efe072f821/chrome/test/data/popup_blocker/popup-subframe.html [add] https://crrev.com/8d1aa16d8f9e854e3f099f9fad9866efe072f821/chrome/test/data/popup_blocker/popup-window-subframe-open.html [modify] https://crrev.com/8d1aa16d8f9e854e3f099f9fad9866efe072f821/content/browser/frame_host/frame_tree_node.cc [modify] https://crrev.com/8d1aa16d8f9e854e3f099f9fad9866efe072f821/content/browser/frame_host/frame_tree_node.h [modify] https://crrev.com/8d1aa16d8f9e854e3f099f9fad9866efe072f821/content/browser/web_contents/web_contents_impl.cc
,
Mar 27 2017
,
Mar 27 2017
Please apply appropriate OS labels. Thank you.
,
Mar 27 2017
Given that we're three weeks out from branch, dropping the stable merge request.
,
Mar 27 2017
And geez, it seems like everyone knows how to popunder this way, so removing RVG.
,
Mar 28 2017
Landed in 59.0.3054.0.
,
Mar 28 2017
Your change meets the bar and is auto-approved for M58. Please go ahead and merge the CL to branch 3029 manually. Please contact milestone owner if you have questions. Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 28 2017
Please ensure to verify the fix, if all looks good merge ASAP so that it will be picked up for next Beta Release, RC cut today (Tuesday-03/28) at 4.00 PM PST.
,
Mar 28 2017
This is verified. Merging.
,
Mar 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7b3733eb24574660bc2b4aeb4b3e5147cae06a88 commit 7b3733eb24574660bc2b4aeb4b3e5147cae06a88 Author: Avi Drissman <avi@chromium.org> Date: Tue Mar 28 20:02:16 2017 Fix popunders spawned from a subframe. BUG= 705316 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2773403002 Cr-Commit-Position: refs/heads/master@{#459835} (cherry picked from commit 8d1aa16d8f9e854e3f099f9fad9866efe072f821) Review-Url: https://codereview.chromium.org/2778113003 . Cr-Commit-Position: refs/branch-heads/3029@{#458} Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471} [modify] https://crrev.com/7b3733eb24574660bc2b4aeb4b3e5147cae06a88/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc [add] https://crrev.com/7b3733eb24574660bc2b4aeb4b3e5147cae06a88/chrome/test/data/popup_blocker/popup-subframe.html [add] https://crrev.com/7b3733eb24574660bc2b4aeb4b3e5147cae06a88/chrome/test/data/popup_blocker/popup-window-subframe-open.html [modify] https://crrev.com/7b3733eb24574660bc2b4aeb4b3e5147cae06a88/content/browser/frame_host/frame_tree_node.cc [modify] https://crrev.com/7b3733eb24574660bc2b4aeb4b3e5147cae06a88/content/browser/frame_host/frame_tree_node.h [modify] https://crrev.com/7b3733eb24574660bc2b4aeb4b3e5147cae06a88/content/browser/web_contents/web_contents_impl.cc
,
Mar 29 2017
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by a...@chromium.org
, Mar 27 2017