Bug 1342462 - UITour: Remove automatic reader view tour based on a URL regex. r=Gijs

MozReview-Commit-ID: 1GCx4tOtjXA

--HG--
extra : rebase_source : 61e0798dc9d6315da864af63a10c78e9874eb039
This commit is contained in:
Matthew Noorenberghe 2017-02-28 21:52:54 -08:00
parent 57e033e108
commit 8e6dfd43c3
3 changed files with 0 additions and 37 deletions

View File

@ -185,8 +185,6 @@ pref("browser.uitour.loglevel", "Error");
pref("browser.uitour.requireSecure", true);
pref("browser.uitour.themeOrigin", "https://addons.mozilla.org/%LOCALE%/firefox/themes/");
pref("browser.uitour.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tour/");
// This is used as a regexp match against the page's URL.
pref("browser.uitour.readerViewTrigger", "^https:\\/\\/www\\.mozilla\\.org\\/[^\\/]+\\/firefox\\/reading\\/start");
// How long to show a Hearbeat survey (two hours, in seconds)
pref("browser.uitour.surveyDuration", 7200);

View File

@ -4647,8 +4647,6 @@ var XULBrowserWindow = {
SocialUI.updateState();
UITour.onLocationChange(location);
gTabletModePageCounter.inc();
// Utility functions for disabling find

View File

@ -32,15 +32,12 @@ XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
"resource:///modules/BrowserUITelemetry.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
"resource://gre/modules/ReaderMode.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent",
"resource:///modules/ReaderParent.jsm");
// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error".
const PREF_LOG_LEVEL = "browser.uitour.loglevel";
const PREF_SEENPAGEIDS = "browser.uitour.seenPageIDs";
const PREF_READERVIEW_TRIGGER = "browser.uitour.readerViewTrigger";
const PREF_SURVEY_DURATION = "browser.uitour.surveyDuration";
const BACKGROUND_PAGE_ACTIONS_ALLOWED = new Set([
@ -297,23 +294,6 @@ this.UITour = {
JSON.stringify([...this.seenPageIDs]));
},
get _readerViewTriggerRegEx() {
delete this._readerViewTriggerRegEx;
let readerViewUITourTrigger = Services.prefs.getCharPref(PREF_READERVIEW_TRIGGER);
return this._readerViewTriggerRegEx = new RegExp(readerViewUITourTrigger, "i");
},
onLocationChange(aLocation) {
// The ReaderView tour page is expected to run in Reader View,
// which disables JavaScript on the page. To get around that, we
// automatically start a pre-defined tour on page load (for hysterical
// raisins the ReaderView tour is known as "readinglist")
let originalUrl = ReaderMode.getOriginalUrl(aLocation);
if (this._readerViewTriggerRegEx.test(originalUrl)) {
this.startSubTour("readinglist");
}
},
onPageEvent(aMessage, aEvent) {
let browser = aMessage.target;
let window = browser.ownerGlobal;
@ -1938,19 +1918,6 @@ this.UITour = {
});
},
startSubTour(aFeature) {
if (aFeature != "string") {
log.error("startSubTour: No feature option specified");
return;
}
if (aFeature == "readinglist") {
ReaderParent.showReaderModeInfoPanel(browser);
} else {
log.error("startSubTour: Unknown feature option specified");
}
},
addNavBarWidget(aTarget, aMessageManager, aCallbackID) {
if (aTarget.node) {
log.error("addNavBarWidget: can't add a widget already present:", aTarget);