diff --git a/UI/AppKit/Application/ApplicationDelegate.mm b/UI/AppKit/Application/ApplicationDelegate.mm index c5d96022284..bc25bb251f9 100644 --- a/UI/AppKit/Application/ApplicationDelegate.mm +++ b/UI/AppKit/Application/ApplicationDelegate.mm @@ -189,6 +189,7 @@ if (activate_tab == Web::HTML::ActivateTab::Yes) { [[controller window] orderFrontRegardless]; + [controller focusLocationToolbarItem]; } [self.managed_tabs addObject:controller]; diff --git a/UI/AppKit/Interface/TabController.mm b/UI/AppKit/Interface/TabController.mm index 233a32636b5..8e4cbfc2279 100644 --- a/UI/AppKit/Interface/TabController.mm +++ b/UI/AppKit/Interface/TabController.mm @@ -145,7 +145,11 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde - (void)onURLChange:(URL::URL const&)url { [self setLocationFieldText:url.serialize()]; - [self.window makeFirstResponder:[self tab].web_view]; + + // Don't steal focus from the location bar when loading the new tab page + if (url != WebView::Application::settings().new_tab_page_url()) { + [self.window makeFirstResponder:[self tab].web_view]; + } } - (void)clearHistory