fune/browser/base/content/newInstall.js
Dave Townsend 5d41d30a08 Bug 1518632: Show the first-run experience for users that get pushed to a new profile. r=Gijs, r=flod, r=stomlinson
On startup of a fresh dedicated profile show a welcome page and a modal dialog
to explain what has happened.

--HG--
extra : rebase_source : 1505cf27f900070debc1f9e1c71ec4bef3bc099d
extra : source : 05200c5388b4f7adc4414268727458515d7b9ed9
2019-01-30 11:31:13 -08:00

50 lines
1.2 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm", {});
function init() {
document.querySelector("button").addEventListener("command", () => {
window.close();
});
if (navigator.platform == "MacIntel") {
hideMenus();
window.addEventListener("unload", showMenus);
}
}
let gHidden = [];
let gCollapsed = [];
let hiddenDoc = Services.appShell.hiddenDOMWindow.document;
function hideItem(id) {
let element = hiddenDoc.getElementById(id);
element.hidden = true;
gHidden.push(element);
}
function collapseItem(id) {
let element = hiddenDoc.getElementById(id);
element.collapsed = true;
gCollapsed.push(element);
}
function hideMenus() {
hideItem("macDockMenuNewWindow");
hideItem("macDockMenuNewPrivateWindow");
collapseItem("aboutName");
collapseItem("menu_preferences");
collapseItem("menu_mac_services");
}
function showMenus() {
for (let menu of gHidden) {
menu.hidden = false;
}
for (let menu of gCollapsed) {
menu.collapsed = false;
}
}