Bug 1374544 - Open features on onboarding to a new tab
MozReview-Commit-ID: 6PjKJJuX657
--- a/browser/app/permissions
+++ b/browser/app/permissions
@@ -8,16 +8,17 @@
# UITour
origin uitour 1 https://www.mozilla.org
origin uitour 1 https://support.mozilla.org
origin uitour 1 https://addons.mozilla.org
origin uitour 1 https://discovery.addons.mozilla.org
origin uitour 1 about:home
origin uitour 1 about:newtab
+origin uitour 1 about:newtab#
# XPInstall
origin install 1 https://addons.mozilla.org
origin install 1 https://testpilot.firefox.com
# Remote troubleshooting
origin remote-troubleshooting 1 https://input.mozilla.org
origin remote-troubleshooting 1 https://support.mozilla.org
--- a/browser/extensions/onboarding/content/onboarding.js
+++ b/browser/extensions/onboarding/content/onboarding.js
@@ -445,16 +445,22 @@ class Onboarding {
this._overlayIcon = this._overlay = this._notificationBar = null;
}
toggleOverlay() {
if (this._tourItems.length == 0) {
// Lazy loading until first toggle.
this._loadTours(this._tours);
}
+ // Add a non-empty hash so that customize and add-on will be opened to
+ // a new tab.
+ dump(this._window.location);
+ if (this._window.location.href === "about:newtab") {
+ this._window.location.hash = "#";
+ }
this.hideNotification();
this._overlay.classList.toggle("onboarding-opened");
let hiddenCheckbox = this._window.document.getElementById("onboarding-tour-hidden-checkbox");
if (hiddenCheckbox.checked) {
this.hide();
}
@@ -805,15 +811,16 @@ if (Services.prefs.getBoolPref("browser.
addEventListener("load", function onLoad(evt) {
if (!content || evt.target != content.document) {
return;
}
removeEventListener("load", onLoad);
let window = evt.target.defaultView;
let location = window.location.href;
- if (location == ABOUT_NEWTAB_URL || location == ABOUT_HOME_URL) {
+ if (location == ABOUT_NEWTAB_URL || location == ABOUT_HOME_URL ||
+ location == ABOUT_NEWTAB_URL + "#") {
window.requestIdleCallback(() => {
new Onboarding(window);
});
}
}, true);
}