[tbb-commits] [tor-browser] 05/14: Bug 1793829 - Don't steal focus for navigations without user activation. r=hsivonen, a=dmeehan

gitolite role git at cupani.torproject.org
Thu Nov 17 14:03:44 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.13.0esr-11.5-1
in repository tor-browser.

commit 8bd3bd20f8fef1d4a55ebf29e87474e1e401cd71
Author: Emilio Cobos Álvarez <emilio at crisal.io>
AuthorDate: Mon Oct 17 20:04:14 2022 +0000

    Bug 1793829 - Don't steal focus for navigations without user activation. r=hsivonen, a=dmeehan
    
    Differential Revision: https://phabricator.services.mozilla.com/D158758
---
 docshell/base/nsDocShell.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 8f1cf78208db..c4ff8414b770 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9097,7 +9097,9 @@ static bool NavigationShouldTakeFocus(nsDocShell* aDocShell,
   if (!aLoadState->AllowFocusMove()) {
     return false;
   }
-
+  if (!aLoadState->HasValidUserGestureActivation()) {
+    return false;
+  }
   const auto& sourceBC = aLoadState->SourceBrowsingContext();
   if (!sourceBC || !sourceBC->IsActive()) {
     // If the navigation didn't come from a foreground tab, then we don't steal

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list