Closed Bug 1742801 Opened 4 years ago Closed 4 years ago

Clicking a link in Gmail and slack.com inline text invokes popup blocker in Nightly (20211124035313)

Categories

(Core :: DOM: Core & HTML, defect, P2)

Unspecified
All
defect

Tracking

()

VERIFIED FIXED
96 Branch
Tracking Status
firefox-esr91 97+ verified
firefox94 --- unaffected
firefox95 --- unaffected
firefox96 --- verified

People

(Reporter: edgar, Assigned: Gijs)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

It looks like gmail also dispatch an untrusted event to open a new tab and the user activation has been consumed by ClickHandlerChild? I am investigating.

Regressed by: 1739929
Has Regression Range: --- → yes

Yeah, gmail preventDefault the original click event, and dispatches an untrusted one.
And the user activation has been consumed by ClickHandlerChild, but ClickHandlerParent doesn't handle the click, https://searchfox.org/mozilla-central/rev/aa8c75b83f636948f708986173965c84cae8c25f/browser/actors/ClickHandlerParent.jsm#96-99.

One possible solution is to consume the activation only if ClickHanlder would handle the click, but I am not sure if it is possible to access whereToOpenLink in the content process? Gijs, any ideas? Thanks!

Flags: needinfo?(gijskruitbosch+bugs)
Attached file test.html

(In reply to Edgar Chen [:edgar] from comment #1)

One possible solution is to consume the activation only if ClickHanlder would handle the click, but I am not sure if it is possible to access whereToOpenLink in the content process? Gijs, any ideas? Thanks!

It isn't right now but we can fix this. Thanks for the testcase, I'll take a look.

Flags: needinfo?(gijskruitbosch+bugs)
Summary: Clicking a link in Gmail invokes popup blocker in Nightly (20211124035313) → Clicking a link in Gmail and slack.com inline text invokes popup blocker in Nightly (20211124035313)

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Blocks: 1742889

This commit does a couple of things:

  • move whereToOpenLink and getRootEvent implementations into BrowserUtils,
    so they can be used from the child process.
  • forward callers in utilityOverlay.js to the BrowserUtils ones
    (bug 1742889 will get rid of the forwarding and update all the callers;
    we might be able to get this and bug 1739929 into beta if risk is low
    enough, and touching a bunch of extra files really doesn't help with
    that)
  • move the lazy-load of BrowserUtils from browser.js to utilityOverlay.js
    This is safe because everywhere that loads browser.js also loads
    utilityOverlay.js. It's needed because there are some places that use
    utilityOverlay.js but not browser.js, and so now they need access to
    BrowserUtils.jsm.
  • use whereToOpenLink to determine if we should avoid consuming the transient
    user gesture activation in the child click handling code.
  • add an automated test based on the testcase in the bug.

When working on this, I initially put the check using whereToOpenLink in
the toplevel of the function, and then when I ran places test to check that
I hadn't broken any places consumers of whereToOpenLink or getRootEvent,
realized that I had broken browser_markPageAsFollowedLink.js, because it
relies on "normal" (ie no modifier key, left button) link clicks making it
to ClickHandlerParent.jsm . I filed bug 1742894 about this. I've not tried
to fix that here, instead I've tried to ensure that paths through this
function are as untouched as possible while still fixing bug 1739929 and
bug 1742801.

Attached file test2.html
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/521231345acc do not consume the user gesture from ClickHandlerChild if ClickHandlerParent will ignore the click anyway, r=edgar
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

[Tracking Requested - why for this release]:

Gijs says in bug 1739929 comment 32 that if we uplift that bug's Gmail fix to ESR 91, we'll also need to uplift this bug's fix.

Flags: qe-verify+

Reproduced the initial issue with Firefox 96.0a1 (20211124155224) on Windows 10x64 and the attached test cases.
The issue is verified fixed with Firefox 96.0b4 (20211213214351) and 97.0a1 (20211213214351) on Windows 10x64, macOS 10.15 and Ubuntu 20.04. The pop-ups are no longer displayed when clicking links from the attached test cases.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Comment on attachment 9252409 [details]
Bug 1742801 - do not consume the user gesture from ClickHandlerChild if ClickHandlerParent will ignore the click anyway, r?mhowell,mtigley,edgar

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Fixes cmd-click / middle click on links in gmail (together with bug 1739929)
  • User impact if declined: see above
  • Fix Landed on Version: 96
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Has had a bunch of bake time, and we've already identified the one regression it's caused (bug 1742801).

Known risk here is the perf regression in bug 1745720. We won't be uplifting that fix considering the risk involved. The overall perf impact should be minimal, and the overall speedometer result won't move.

Attachment #9252409 - Flags: approval-mozilla-esr91?

Comment on attachment 9252409 [details]
Bug 1742801 - do not consume the user gesture from ClickHandlerChild if ClickHandlerParent will ignore the click anyway, r?mhowell,mtigley,edgar

Approved for 91.6esr.

Attachment #9252409 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+

Verified fixed with Firefox 91.6.0esr (20220131231250) on Windows 10x64, macOS 10.15, and Ubuntu 20.04. The pop-ups are no longer displayed when clicking links from the attached test cases.

Blocks: 1896249
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: