Commit 823f7f78 authored by Kirk Steuber's avatar Kirk Steuber
Browse files

Bug 1429164 - Add enterprise policy to prevent showing the profile import wizard r=Felipe,Gijs

MozReview-Commit-ID: Lg7r1NrFbKl

--HG--
extra : rebase_source : d81e065a5e99e15c24dcb4a64dff4b0341f6efc4
parent 7ca07461
......@@ -291,6 +291,15 @@ var Policies = {
}
},
"DisableProfileImport": {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("profileImport");
setAndLockPref("browser.newtabpage.activity-stream.migrationExpired", true);
}
}
},
"DisableProfileRefresh": {
onBeforeUIStartup(manager, param) {
if (param) {
......
......@@ -234,6 +234,13 @@
"type": "boolean"
},
"DisableProfileImport": {
"description": "Disables the Firefox \"Import data from another browser\" button",
"first_available": "60.0",
"type": "boolean"
},
"DisableProfileRefresh": {
"description": "Disables the \"Refresh Firefox\" button in about:support",
"first_available": "60.0",
......
......@@ -38,6 +38,7 @@ support-files =
[browser_policy_disable_popup_blocker.js]
[browser_policy_disable_privatebrowsing.js]
[browser_policy_disable_profile_reset.js]
[browser_policy_disable_profile_import.js]
[browser_policy_disable_safemode.js]
[browser_policy_disable_shield.js]
[browser_policy_disable_telemetry.js]
......
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
async function openLibrary() {
return new Promise(resolve => {
let library = window.openDialog("chrome://browser/content/places/places.xul", "",
"chrome,toolbar=yes,dialog=no,resizable");
waitForFocus(() => resolve(library), library);
});
}
add_task(async function test_disable_profile_import() {
await setupPolicyEngineWithJson({
"policies": {
"DisableProfileImport": true
}
});
let library = await openLibrary();
let menu = library.document.getElementById("maintenanceButtonPopup");
let promisePopupShown = BrowserTestUtils.waitForEvent(menu, "popupshown");
menu.openPopup();
await promisePopupShown;
let profileImportButton = library.document.getElementById("browserImport");
is(profileImportButton.disabled, true, "Profile Import button should be disabled");
let promisePopupHidden = BrowserTestUtils.waitForEvent(menu, "popuphidden");
menu.hidePopup();
await promisePopupHidden;
await BrowserTestUtils.closeWindow(library);
checkLockedPref("browser.newtabpage.activity-stream.migrationExpired", true);
});
......@@ -189,6 +189,10 @@ var PlacesOrganizer = {
document.getElementById("placesContext")
.removeChild(document.getElementById("placesContext_show:info"));
if (!Services.policies.isAllowed("profileImport")) {
document.getElementById("OrganizerCommand_browserImport").setAttribute("disabled", true);
}
ContentArea.focus();
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment