Bug 966933 - [Australis] UITour: Add a UI tour link in the Help menu. r=Gijs
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -245,16 +245,17 @@ pref("xpinstall.whitelist.add.180", "mar
pref("lightweightThemes.update.enabled", true);
// UI tour experience.
pref("browser.uitour.enabled", true);
pref("browser.uitour.requireSecure", true);
pref("browser.uitour.themeOrigin", "https://addons.mozilla.org/%LOCALE%/firefox/themes/");
pref("browser.uitour.pinnedTabUrl", "https://support.mozilla.org/%LOCALE%/kb/pinned-tabs-keep-favorite-websites-open");
+pref("browser.uitour.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tour/");
pref("browser.uitour.whitelist.add.260", "www.mozilla.org,support.mozilla.org");
pref("browser.customizemode.tip0.shown", false);
pref("browser.customizemode.tip0.learnMoreUrl", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/customize");
pref("keyword.enabled", true);
pref("general.useragent.locale", "@AB_CD@");
--- a/browser/base/content/baseMenuOverlay.xul
+++ b/browser/base/content/baseMenuOverlay.xul
@@ -47,16 +47,20 @@
onclick="checkForMiddleClick(this, event);"
label="&productHelp.label;"
accesskey="&productHelp.accesskey;"
#ifdef XP_MACOSX
key="key_openHelpMac"/>
#else
/>
#endif
+ <menuitem id="menu_openTour"
+ oncommand="openTourPage();"
+ label="&helpShowTour.label;"
+ accesskey="&helpShowTour.accesskey;"/>
<menuitem id="menu_keyboardShortcuts"
oncommand="openHelpLink('keyboard-shortcuts')"
onclick="checkForMiddleClick(this, event);"
label="&helpKeyboardShortcuts.label;"
accesskey="&helpKeyboardShortcuts.accesskey;"/>
#ifdef MOZ_SERVICES_HEALTHREPORT
<menuitem id="healthReport"
label="&healthReport.label;"
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -563,16 +563,23 @@ function openHealthReport()
function openFeedbackPage()
{
var url = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter)
.formatURLPref("app.feedback.baseURL");
openUILinkIn(url, "tab");
}
+function openTourPage()
+{
+ let scope = {}
+ Components.utils.import("resource:///modules/UITour.jsm", scope);
+ openUILinkIn(scope.UITour.url, "tab");
+}
+
function buildHelpMenu()
{
// Enable/disable the "Report Web Forgery" menu item.
if (typeof gSafeBrowsing != "undefined")
gSafeBrowsing.setReportPhishingMenu();
}
function isElementVisible(aElement)
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -37,16 +37,17 @@ const BUCKET_TIMESTEPS = [
60 * 60 * 1000, // Until 1 hour after tab is closed/inactive.
];
// Time after which seen Page IDs expire.
const SEENPAGEID_EXPIRY = 2 * 7 * 24 * 60 * 60 * 1000; // 2 weeks.
this.UITour = {
+ url: null,
seenPageIDs: null,
pageIDSourceTabs: new WeakMap(),
pageIDSourceWindows: new WeakMap(),
/* Map from browser windows to a set of tabs in which a tour is open */
originTabs: new WeakMap(),
/* Map from browser windows to a set of pinned tabs opened by (a) tour(s) */
pinnedTabs: new WeakMap(),
urlbarCapture: new WeakMap(),
@@ -122,16 +123,21 @@ this.UITour = {
// Lazy getter is initialized here so it can be replicated any time
// in a test.
delete this.seenPageIDs;
Object.defineProperty(this, "seenPageIDs", {
get: this.restoreSeenPageIDs.bind(this),
configurable: true,
});
+ delete this.url;
+ XPCOMUtils.defineLazyGetter(this, "url", function () {
+ return Services.urlFormatter.formatURLPref("browser.uitour.url");
+ });
+
UITelemetry.addSimpleMeasureFunction("UITour",
this.getTelemetry.bind(this));
// Clear the availableTargetsCache on widget changes.
let listenerMethods = [
"onWidgetAdded",
"onWidgetMoved",
"onWidgetRemoved",