Skip to content

Commit 0daf3fe

Browse files
committed
toggle to remove focus of the search bar at startup
1 parent 3277e06 commit 0daf3fe

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/browser/base/content/ZenStartup.mjs

Lines changed: 10 additions & 2 deletions
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)