Bug 1793829 - Don't steal focus for navigations without user activation. r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D158758
This commit is contained in:
Emilio Cobos Álvarez 2022-10-17 20:04:14 +00:00
parent f71c987669
commit d798a8796a

View File

@ -9223,7 +9223,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