Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b1d750a

Browse files
committedNov 12, 2024
toggle to remove focus of the search bar at startup
1 parent 3277e06 commit b1d750a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
 

‎src/browser/app/profile/zen-browser.js

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ pref('zen.essentials.enabled', true);
181181
// Zen Watermark
182182
pref('zen.watermark.enabled', true, sticky);
183183

184+
// Zen Urlbar
185+
pref('zen.urlbar.disable-initial-focus', false);
186+
184187
// Smooth scrolling
185188
pref('apz.overscroll.enabled', true); // not DEFAULT on Linux
186189
pref('general.smoothScroll', true); // DEFAULT

‎src/browser/base/content/ZenStartup.mjs

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
const lazy = {};
33
XPCOMUtils.defineLazyPreferenceGetter(lazy, 'sidebarHeightThrottle', 'zen.view.sidebar-height-throttle', 500);
4+
XPCOMUtils.defineLazyPreferenceGetter(
5+
lazy,
6+
'disableInitialUrlBarFocus',
7+
'zen.urlbar.disable-initial-focus',
8+
false
9+
);
410
var ZenStartup = {
511
init() {
612
this.logHeader();
@@ -137,8 +143,10 @@
137143
},
138144

139145
_initSearchBar() {
140-
// Only focus the url bar
141-
gURLBar.focus();
146+
// Check if focus should stay on page or switch to url bar
147+
if (!lazy.disableInitialUrlBarFocus) {
148+
gURLBar.focus();
149+
}
142150

143151
gURLBar._initCopyCutController();
144152
gURLBar._initPasteAndGo();

0 commit comments

Comments
 (0)
Please sign in to comment.