зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1614651 - Add hidden pref to disable restrictions on Search Tips to help with testing. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D62437 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
255a87c4a6
Коммит
80f63ae251
|
@ -124,6 +124,11 @@ const PREF_URLBAR_DEFAULTS = new Map([
|
|||
// The number of times the user has been shown the redirect search tip.
|
||||
["searchTips.redirect.shownCount", 0],
|
||||
|
||||
// Hidden pref. Disables checks that prevent search tips being shown, thus
|
||||
// showing them every time the newtab page or the default search engine
|
||||
// homepage is opened.
|
||||
["searchTips.test.ignoreShowLimits", false],
|
||||
|
||||
// Whether speculative connections should be enabled.
|
||||
["speculativeConnect.enabled", true],
|
||||
|
||||
|
|
|
@ -280,7 +280,8 @@ class ProviderSearchTips extends UrlbarProvider {
|
|||
if (
|
||||
!UrlbarPrefs.get("update1.searchTips") ||
|
||||
!cfrFeaturesUserPref ||
|
||||
this.disableTipsForCurrentSession
|
||||
(this.disableTipsForCurrentSession &&
|
||||
!UrlbarPrefs.get("searchTips.test.ignoreShowLimits"))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
@ -298,14 +299,16 @@ class ProviderSearchTips extends UrlbarProvider {
|
|||
let instance = {};
|
||||
this._maybeShowTipForUrlInstance = instance;
|
||||
|
||||
let ignoreShowLimits = UrlbarPrefs.get("searchTips.test.ignoreShowLimits");
|
||||
|
||||
// Don't show a tip if the browser is already showing some other notification.
|
||||
if (isBrowserShowingNotification()) {
|
||||
if (isBrowserShowingNotification() && !ignoreShowLimits) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't show a tip if the browser has been updated recently.
|
||||
let date = await lastBrowserUpdateDate();
|
||||
if (Date.now() - date <= LAST_UPDATE_THRESHOLD_MS) {
|
||||
if (Date.now() - date <= LAST_UPDATE_THRESHOLD_MS && !ignoreShowLimits) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -332,7 +335,7 @@ class ProviderSearchTips extends UrlbarProvider {
|
|||
// If we've shown this type of tip the maximum number of times over all
|
||||
// sessions, don't show it again.
|
||||
let shownCount = UrlbarPrefs.get(shownCountPrefName);
|
||||
if (shownCount >= MAX_SHOWN_COUNT) {
|
||||
if (shownCount >= MAX_SHOWN_COUNT && !ignoreShowLimits) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче