Skip to content

Commit

Permalink
Bug 1846028 - Add .featureGate pref to clipboard suggestion. r=mak
Browse files Browse the repository at this point in the history
Depends on D184502

Differential Revision: https://phabricator.services.mozilla.com/D184934
  • Loading branch information
klubana-m committed Aug 1, 2023
1 parent 5ddb360 commit 985fcbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ pref("browser.urlbar.maxHistoricalSearchSuggestions", 2);
// The default behavior for the urlbar can be configured to use any combination
// of the match filters with each additional filter adding more results (union).
pref("browser.urlbar.suggest.bookmark", true);
pref("browser.urlbar.suggest.clipboard", false);
pref("browser.urlbar.suggest.clipboard", true);
pref("browser.urlbar.suggest.history", true);
pref("browser.urlbar.suggest.openpage", true);
pref("browser.urlbar.suggest.remotetab", true);
Expand Down Expand Up @@ -426,6 +426,9 @@ pref("browser.urlbar.suggest.calculator", false);
// Feature gate pref for weather suggestions in the urlbar.
pref("browser.urlbar.weather.featureGate", false);

// Feature gate pref for clipboard suggestions in the urlbar.
pref("browser.urlbar.clipboard.featureGate", false);

// When false, the weather suggestion will not be fetched when a VPN is
// detected. When true, it will be fetched anyway.
pref("browser.urlbar.weather.ignoreVPN", false);
Expand Down
5 changes: 4 additions & 1 deletion browser/components/urlbar/UrlbarPrefs.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const PREF_URLBAR_DEFAULTS = new Map([
["suggest.calculator", false],

// Whether results will include clipboard results.
["suggest.clipboard", false],
["suggest.clipboard", true],

// Whether results will include search engines (e.g. tab-to-search).
["suggest.engines", true],
Expand Down Expand Up @@ -448,6 +448,9 @@ const PREF_URLBAR_DEFAULTS = new Map([

// Feature gate pref for rich suggestions being shown in the urlbar.
["richSuggestions.featureGate", false],

// Feature gate pref for clipboard suggestions in the urlbar.
["clipboard.featureGate", false],
]);

const PREF_OTHER_DEFAULTS = new Map([
Expand Down
1 change: 1 addition & 0 deletions browser/components/urlbar/UrlbarProviderClipboard.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ProviderClipboard extends UrlbarProvider {
isActive(queryContext, controller) {
// Return clipboard results only for empty searches.
if (
!lazy.UrlbarPrefs.get("clipboard.featureGate") ||
!lazy.UrlbarPrefs.get("suggest.clipboard") ||
queryContext.searchString
) {
Expand Down

0 comments on commit 985fcbf

Please sign in to comment.