mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1695747 - Remove sponsored top sites from address bar results. r=mikedeboer
Differential Revision: https://phabricator.services.mozilla.com/D106866
This commit is contained in:
parent
2e8a91f39a
commit
f33af33f30
@ -365,6 +365,9 @@ pref("browser.urlbar.openintab", false);
|
||||
// If true, we show tail suggestions when available.
|
||||
pref("browser.urlbar.richSuggestions.tail", true);
|
||||
|
||||
// If true, top sites may include sponsored ones.
|
||||
pref("browser.urlbar.sponsoredTopSites", false);
|
||||
|
||||
// Controls the empty search behavior in Search Mode:
|
||||
// 0 - Show nothing
|
||||
// 1 - Show search history
|
||||
|
@ -205,6 +205,9 @@ const PREF_URLBAR_DEFAULTS = new Map([
|
||||
// Remove redundant portions from URLs.
|
||||
["trimURLs", true],
|
||||
|
||||
// If true, top sites may include sponsored ones.
|
||||
["sponsoredTopSites", false],
|
||||
|
||||
// Results will include a built-in set of popular domains when this is true.
|
||||
["usepreloadedtopurls.enabled", false],
|
||||
|
||||
|
@ -122,6 +122,10 @@ class ProviderTopSites extends UrlbarProvider {
|
||||
// on about:newtab.
|
||||
sites = sites.filter(site => site);
|
||||
|
||||
if (!UrlbarPrefs.get("sponsoredTopSites")) {
|
||||
sites = sites.filter(site => !site.sponsored_position);
|
||||
}
|
||||
|
||||
// This is done here, rather than in the global scope, because
|
||||
// TOP_SITES_DEFAULT_ROWS causes the import of Reducers.jsm, and we want to
|
||||
// do that only when actually querying for Top Sites.
|
||||
|
@ -42,6 +42,7 @@ add_task(async function setup() {
|
||||
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["browser.urlbar.sponsoredTopSites", true],
|
||||
["browser.urlbar.suggest.topsites", true],
|
||||
["browser.newtabpage.activity-stream.default.sites", EN_US_TOPSITES],
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user