Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle to remove focus of the search bar at startup #2920

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/browser/app/profile/zen-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ pref('zen.workspaces.container-specific-essentials-enabled', false);
// Zen Watermark
pref('zen.watermark.enabled', true, sticky);

// Zen Urlbar
pref('zen.urlbar.disable-initial-focus', false);

// Smooth scrolling
pref('apz.overscroll.enabled', true); // not DEFAULT on Linux
pref('general.smoothScroll', true); // DEFAULT
Expand Down
8 changes: 6 additions & 2 deletions src/browser/base/content/ZenStartup.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
const lazy = {};
XPCOMUtils.defineLazyPreferenceGetter(lazy, 'sidebarHeightThrottle', 'zen.view.sidebar-height-throttle', 500);
XPCOMUtils.defineLazyPreferenceGetter(lazy, 'disableInitialUrlBarFocus', 'zen.urlbar.disable-initial-focus', false);
var ZenStartup = {
init() {
this.logHeader();
Expand Down Expand Up @@ -97,8 +99,10 @@
},

_initSearchBar() {
// Only focus the url bar
gURLBar.focus();
// Check if focus should stay on page or switch to url bar
if (!lazy.disableInitialUrlBarFocus) {
gURLBar.focus();
}

gURLBar._initCopyCutController();
gURLBar._initPasteAndGo();
Expand Down