From d6a57956e59e32949a9525b62c18020acd76a045 Mon Sep 17 00:00:00 2001 From: Alexander Kolenaty Date: Wed, 5 Mar 2025 21:44:21 +0100 Subject: [PATCH] Add toggle to remove searchbar focus --- src/browser/app/profile/zen-browser.js | 1 + src/browser/base/content/ZenStartup.mjs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index 62aa95df0..4664d2d20 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -122,6 +122,7 @@ pref('zen.urlbar.behavior', 'floating-on-type'); // default, floating-on-type, f pref('zen.urlbar.wait-to-clear', 45000); // in ms (default 45s) pref('zen.urlbar.show-domain-only-in-sidebar', true); pref('zen.urlbar.hide-one-offs', true); +pref('zen.urlbar.disable-initial-focus', false); #ifdef XP_MACOSX // Disable for macos in the meantime until @HarryHeres finds a solution for hight DPI screens diff --git a/src/browser/base/content/ZenStartup.mjs b/src/browser/base/content/ZenStartup.mjs index 188886456..3e6cebd42 100644 --- a/src/browser/base/content/ZenStartup.mjs +++ b/src/browser/base/content/ZenStartup.mjs @@ -125,8 +125,9 @@ }, _initSearchBar() { - // Only focus the url bar - gURLBar.focus(); + if (!Services.prefs.getBoolPref('zen.urlbar.disable-initial-focus', false)) { + gURLBar.focus(); + } gURLBar._initCopyCutController(); gURLBar._initPasteAndGo();