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

gitolite role git at cupani.torproject.org
Wed Nov 16 20:42:53 UTC 2022


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

richard pushed a commit to branch base-browser-102.5.0esr-12.0-1
in repository tor-browser.

commit 098816c19e9fe027e40eb02a5feac2fa473b5bf6
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 f886070364b6..1c38a851c5ec 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9248,7 +9248,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