Skip to content

Commit 297a74e

Browse files
committed
Instant one off searches
1 parent 58ec2ce commit 297a74e

File tree

6 files changed

+24
-3
lines changed

6 files changed

+24
-3
lines changed

browser/app/profile/firefox.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@ pref("browser.urlbar.resultMenu.keyboardAccessible", true);
569569
// If true, we show tail suggestions when available.
570570
pref("browser.urlbar.richSuggestions.tail", true);
571571

572+
// If true, top sites may include sponsored ones.
573+
pref("browser.urlbar.oneOffsInstant", true);
574+
572575
// If true, top sites may include sponsored ones.
573576
pref("browser.urlbar.sponsoredTopSites", false);
574577

browser/components/preferences/main.inc.xhtml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@
114114
</hbox>
115115
<description class="indent tip-caption" data-l10n-id="r3dfox-caption-text-desc"/>
116116

117+
<hbox align="center">
118+
<checkbox id="r3dfoxoneoffs"
119+
data-l10n-id="r3dfox-one-offs"
120+
preference="browser.urlbar.oneOffsInstant"/>
121+
</hbox>
122+
<description class="indent tip-caption" data-l10n-id="r3dfox-one-offs-desc"/>
123+
117124
<hbox align="center">
118125
<checkbox id="r3dfoxe10s"
119126
data-l10n-id="r3dfox-e10s"

browser/components/preferences/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Preferences.addAll([
7272
{ id: "r3dfox.aero.fog", type: "bool" },
7373
{ id: "r3dfox.force.transparency", type: "bool" },
7474
{ id: "r3dfox.caption.text.color", type: "bool" },
75+
{ id: "browser.urlbar.oneOffsInstant", type: "bool" },
7576
{ id: "browser.e10s.disabled", type: "bool" },
7677

7778
/* Tab preferences

browser/components/urlbar/UrlbarPrefs.sys.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ const PREF_URLBAR_DEFAULTS = new Map([
167167
// Timeout for Merino fetches (ms).
168168
["merino.timeoutMs", 200],
169169

170+
// Whether the urlbar one-offs act as search filters instead of executing a
171+
// search immediately.
172+
["oneOffsInstant", true],
173+
170174
// Whether addresses and search results typed into the address bar
171175
// should be opened in new tabs by default.
172176
["openintab", false],

browser/components/urlbar/UrlbarSearchOneOffs.sys.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,10 @@ export class UrlbarSearchOneOffs extends SearchOneOffs {
366366
// Some key combinations should execute a search immediately. We handle
367367
// these here, outside the switch statement.
368368
if (
369-
userTypedSearchString &&
370-
engine &&
371-
(event.shiftKey || where != "current")
369+
lazy.UrlbarPrefs.get("oneOffsInstant") ||
370+
(userTypedSearchString &&
371+
engine &&
372+
(event.shiftKey || where != "current"))
372373
) {
373374
this.input.handleNavigation({
374375
event,

browser/locales/en-US/browser/preferences/preferences.ftl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ r3dfox-caption-text =
195195
196196
r3dfox-caption-text-desc = Enable for white caption text.
197197
198+
r3dfox-one-offs =
199+
.label = Instant one off searches
200+
201+
r3dfox-one-offs-desc = Enable for instant one off searches.
202+
198203
r3dfox-e10s =
199204
.label = (BETA) Disable e10s (multiprocess)
200205

0 commit comments

Comments
 (0)