Bug 1869153, remove file import preference signon.management.page.fileImport.enabled and supporting code since it is enabled by default, r=mconley,fluent-reviewers,credential-management-reviewers,migration-reviewers,issammani
Differential Revision: https://phabricator.services.mozilla.com/D223852
This commit is contained in:
@@ -2494,8 +2494,6 @@ pref("extensions.pocket.refresh.emailButton.enabled", false);
|
|||||||
// Hides the recently saved section in the home panel.
|
// Hides the recently saved section in the home panel.
|
||||||
pref("extensions.pocket.refresh.hideRecentSaves.enabled", false);
|
pref("extensions.pocket.refresh.hideRecentSaves.enabled", false);
|
||||||
|
|
||||||
pref("signon.management.page.fileImport.enabled", true);
|
|
||||||
|
|
||||||
// "available" - user can see feature offer.
|
// "available" - user can see feature offer.
|
||||||
// "offered" - we have offered feature to user and they have not yet made a decision.
|
// "offered" - we have offered feature to user and they have not yet made a decision.
|
||||||
// "enabled" - user opted in to the feature.
|
// "enabled" - user opted in to the feature.
|
||||||
|
|||||||
@@ -131,9 +131,6 @@ export class AboutLoginsChild extends JSWindowActorChild {
|
|||||||
|
|
||||||
return gPrimaryPasswordPromise;
|
return gPrimaryPasswordPromise;
|
||||||
},
|
},
|
||||||
fileImportEnabled: Services.prefs.getBoolPref(
|
|
||||||
"signon.management.page.fileImport.enabled"
|
|
||||||
),
|
|
||||||
// Default to enabled just in case a search is attempted before we get a response.
|
// Default to enabled just in case a search is attempted before we get a response.
|
||||||
primaryPasswordEnabled: true,
|
primaryPasswordEnabled: true,
|
||||||
passwordRevealVisible: true,
|
passwordRevealVisible: true,
|
||||||
|
|||||||
@@ -251,9 +251,6 @@
|
|||||||
<a data-l10n-name="passwords-help-link" class="intro-help-link" target="_blank" rel="noreferrer"></a>
|
<a data-l10n-name="passwords-help-link" class="intro-help-link" target="_blank" rel="noreferrer"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="description intro-import-text no-file-import" hidden data-l10n-id="about-logins-intro-browser-only-import">
|
|
||||||
<a data-l10n-name="import-link" href="#"></a>
|
|
||||||
</p>
|
|
||||||
<p class="description intro-import-text file-import" hidden data-l10n-id="about-logins-intro-import3">
|
<p class="description intro-import-text file-import" hidden data-l10n-id="about-logins-intro-import3">
|
||||||
<a data-l10n-name="import-browser-link" href="#"></a>
|
<a data-l10n-name="import-browser-link" href="#"></a>
|
||||||
<a data-l10n-name="import-file-link" href="#"></a>
|
<a data-l10n-name="import-file-link" href="#"></a>
|
||||||
|
|||||||
@@ -54,10 +54,9 @@ export default class LoginIntro extends HTMLElement {
|
|||||||
.querySelector(".intro-help-link")
|
.querySelector(".intro-help-link")
|
||||||
.setAttribute("href", supportURL);
|
.setAttribute("href", supportURL);
|
||||||
|
|
||||||
let importClass = window.AboutLoginsUtils.fileImportEnabled
|
let importText = this.shadowRoot.querySelector(
|
||||||
? ".intro-import-text.file-import"
|
".intro-import-text.file-import"
|
||||||
: ".intro-import-text.no-file-import";
|
);
|
||||||
let importText = this.shadowRoot.querySelector(importClass);
|
|
||||||
importText.addEventListener("click", this);
|
importText.addEventListener("click", this);
|
||||||
importText.hidden = !window.AboutLoginsUtils.importVisible;
|
importText.hidden = !window.AboutLoginsUtils.importVisible;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,9 +158,6 @@ export default class MenuButton extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_showMenu() {
|
_showMenu() {
|
||||||
this._menu.querySelector(".menuitem-import-file").hidden =
|
|
||||||
!window.AboutLoginsUtils.fileImportEnabled;
|
|
||||||
|
|
||||||
this._menu.hidden = false;
|
this._menu.hidden = false;
|
||||||
|
|
||||||
// Event listeners to close the menu
|
// Event listeners to close the menu
|
||||||
|
|||||||
@@ -84,11 +84,7 @@ add_task(async function test_no_logins_class() {
|
|||||||
"When logged in the message should update"
|
"When logged in the message should update"
|
||||||
);
|
);
|
||||||
|
|
||||||
let importClass = Services.prefs.getBoolPref(
|
const importClass = ".intro-import-text.file-import";
|
||||||
"signon.management.page.fileImport.enabled"
|
|
||||||
)
|
|
||||||
? ".intro-import-text.file-import"
|
|
||||||
: ".intro-import-text.no-file-import";
|
|
||||||
Assert.equal(
|
Assert.equal(
|
||||||
ContentTaskUtils.isHidden(
|
ContentTaskUtils.isHidden(
|
||||||
loginIntro.shadowRoot.querySelector(importClass)
|
loginIntro.shadowRoot.querySelector(importClass)
|
||||||
|
|||||||
@@ -65,12 +65,7 @@ class CsvImportHelper {
|
|||||||
|
|
||||||
function getImportMenuItem() {
|
function getImportMenuItem() {
|
||||||
let menuButton = window.document.querySelector("menu-button");
|
let menuButton = window.document.querySelector("menu-button");
|
||||||
let importButton = menuButton.shadowRoot.querySelector(
|
return menuButton.shadowRoot.querySelector(".menuitem-import-file");
|
||||||
".menuitem-import-file"
|
|
||||||
);
|
|
||||||
// Force the menu item to be visible for the test.
|
|
||||||
importButton.hidden = false;
|
|
||||||
return importButton;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserTestUtils.synthesizeMouseAtCenter(getImportMenuItem, {}, browser);
|
BrowserTestUtils.synthesizeMouseAtCenter(getImportMenuItem, {}, browser);
|
||||||
|
|||||||
@@ -90,9 +90,6 @@ Object.defineProperty(window, "AboutLoginsUtils", {
|
|||||||
login1.password == login2.password
|
login1.password == login2.password
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
fileImportEnabled: SpecialPowers.getBoolPref(
|
|
||||||
"signon.management.page.fileImport.enabled"
|
|
||||||
),
|
|
||||||
primaryPasswordEnabled: false,
|
primaryPasswordEnabled: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -135,9 +135,7 @@ add_task(async function test_menu_open_close() {
|
|||||||
await SimpleTest.promiseWaitForCondition(() => firstVisibleItem.matches(":focus"),
|
await SimpleTest.promiseWaitForCondition(() => firstVisibleItem.matches(":focus"),
|
||||||
"waiting for firstVisibleItem to get focus again");
|
"waiting for firstVisibleItem to get focus again");
|
||||||
ok(firstVisibleItem.matches(":focus"), "firstVisibleItem should be focused after tabbing to it again");
|
ok(firstVisibleItem.matches(":focus"), "firstVisibleItem should be focused after tabbing to it again");
|
||||||
if (SpecialPowers.getBoolPref("signon.management.page.fileImport.enabled")) {
|
sendKey("TAB"); // Import from file
|
||||||
sendKey("TAB"); // Import from file
|
|
||||||
}
|
|
||||||
sendKey("TAB"); // Export
|
sendKey("TAB"); // Export
|
||||||
sendKey("TAB"); // Remove All Logins
|
sendKey("TAB"); // Remove All Logins
|
||||||
|
|
||||||
@@ -189,14 +187,12 @@ add_task(async function test_menu_keyboard_cycling() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let allItems = [
|
let allItems = [
|
||||||
|
"menuitem-import-file",
|
||||||
"menuitem-export",
|
"menuitem-export",
|
||||||
"menuitem-remove-all-logins",
|
"menuitem-remove-all-logins",
|
||||||
"menuitem-preferences",
|
"menuitem-preferences",
|
||||||
"menuitem-help",
|
"menuitem-help",
|
||||||
];
|
];
|
||||||
if (SpecialPowers.getBoolPref("signon.management.page.fileImport.enabled")) {
|
|
||||||
allItems = ["menuitem-import-file", ...allItems];
|
|
||||||
}
|
|
||||||
if (navigator.platform == "Win32" || navigator.platform == "MacIntel") {
|
if (navigator.platform == "Win32" || navigator.platform == "MacIntel") {
|
||||||
allItems = ["menuitem-import-browser", ...allItems];
|
allItems = ["menuitem-import-browser", ...allItems];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,10 +165,7 @@ export class PasswordFileMigrator extends FileMigratorBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get enabled() {
|
get enabled() {
|
||||||
return Services.prefs.getBoolPref(
|
return true;
|
||||||
"signon.management.page.fileImport.enabled",
|
|
||||||
false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get displayedResourceTypes() {
|
get displayedResourceTypes() {
|
||||||
|
|||||||
@@ -695,11 +695,7 @@ export class MigrationWizardParent extends JSWindowActorParent {
|
|||||||
profileMigrationData & MigrationUtils.resourceTypes[resourceType] ||
|
profileMigrationData & MigrationUtils.resourceTypes[resourceType] ||
|
||||||
(migrator.constructor.key == lazy.SafariProfileMigrator?.key &&
|
(migrator.constructor.key == lazy.SafariProfileMigrator?.key &&
|
||||||
MigrationUtils.resourceTypes[resourceType] ==
|
MigrationUtils.resourceTypes[resourceType] ==
|
||||||
MigrationUtils.resourceTypes.PASSWORDS &&
|
MigrationUtils.resourceTypes.PASSWORDS)
|
||||||
Services.prefs.getBoolPref(
|
|
||||||
"signon.management.page.fileImport.enabled",
|
|
||||||
false
|
|
||||||
))
|
|
||||||
) {
|
) {
|
||||||
availableResourceTypes.push(resourceType);
|
availableResourceTypes.push(resourceType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,6 @@ add_task(async function test_browser_no_programs() {
|
|||||||
return [];
|
return [];
|
||||||
});
|
});
|
||||||
|
|
||||||
// Let's enable the Passwords CSV import by default so that it appears
|
|
||||||
// as a file migrator.
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [["signon.management.page.fileImport.enabled", true]],
|
|
||||||
});
|
|
||||||
|
|
||||||
await withMigrationWizardDialog(async prefsWin => {
|
await withMigrationWizardDialog(async prefsWin => {
|
||||||
let dialog = prefsWin.document.querySelector("#migrationWizardDialog");
|
let dialog = prefsWin.document.querySelector("#migrationWizardDialog");
|
||||||
let wizard = dialog.querySelector("migration-wizard");
|
let wizard = dialog.querySelector("migration-wizard");
|
||||||
@@ -51,42 +45,5 @@ add_task(async function test_browser_no_programs() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Now disable all file migrators to make sure that the "Import from file"
|
|
||||||
// button is hidden.
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [
|
|
||||||
["signon.management.page.fileImport.enabled", false],
|
|
||||||
["browser.migrate.bookmarks-file.enabled", false],
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
await withMigrationWizardDialog(async prefsWin => {
|
|
||||||
let dialog = prefsWin.document.querySelector("#migrationWizardDialog");
|
|
||||||
let wizard = dialog.querySelector("migration-wizard");
|
|
||||||
let shadow = wizard.openOrClosedShadowRoot;
|
|
||||||
let deck = shadow.querySelector("#wizard-deck");
|
|
||||||
|
|
||||||
await BrowserTestUtils.waitForMutationCondition(
|
|
||||||
deck,
|
|
||||||
{ attributeFilter: ["selected-view"] },
|
|
||||||
() => {
|
|
||||||
return (
|
|
||||||
deck.getAttribute("selected-view") ==
|
|
||||||
"page-" + MigrationWizardConstants.PAGES.NO_BROWSERS_FOUND
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
Assert.ok(
|
|
||||||
true,
|
|
||||||
"Went to no browser page after attempting to search for migrators."
|
|
||||||
);
|
|
||||||
let chooseImportFromFile = shadow.querySelector("#choose-import-from-file");
|
|
||||||
Assert.ok(
|
|
||||||
chooseImportFromFile.hidden,
|
|
||||||
"Selecting a file migrator should not be possible."
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
sandbox.restore();
|
sandbox.restore();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
* selection page when only file migrators are found.
|
* selection page when only file migrators are found.
|
||||||
*/
|
*/
|
||||||
add_task(async function test_only_file_migrators() {
|
add_task(async function test_only_file_migrators() {
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [["signon.management.page.fileImport.enabled", true]],
|
|
||||||
});
|
|
||||||
|
|
||||||
let sandbox = sinon.createSandbox();
|
let sandbox = sinon.createSandbox();
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
sandbox.restore();
|
sandbox.restore();
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ add_setup(async function () {
|
|||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
MockFilePicker.cleanup();
|
MockFilePicker.cleanup();
|
||||||
});
|
});
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [["signon.management.page.fileImport.enabled", true]],
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -410,59 +407,3 @@ add_task(async function test_safari_password_skip() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests that importing from passwords for Safari doesn't exist if
|
|
||||||
* signon.management.page.fileImport.enabled is false.
|
|
||||||
*/
|
|
||||||
add_task(async function test_safari_password_disabled() {
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [["signon.management.page.fileImport.enabled", false]],
|
|
||||||
});
|
|
||||||
|
|
||||||
let sandbox = sinon.createSandbox();
|
|
||||||
registerCleanupFunction(() => {
|
|
||||||
sandbox.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
let safariMigrator = new SafariProfileMigrator();
|
|
||||||
sandbox.stub(MigrationUtils, "getMigrator").resolves(safariMigrator);
|
|
||||||
|
|
||||||
// We're not testing the permission flow here, so let's pretend that we
|
|
||||||
// always have permission to read resources from the disk.
|
|
||||||
sandbox
|
|
||||||
.stub(SafariProfileMigrator.prototype, "hasPermissions")
|
|
||||||
.resolves(true);
|
|
||||||
|
|
||||||
// Have the migrator claim that only BOOKMARKS are only available.
|
|
||||||
sandbox
|
|
||||||
.stub(SafariProfileMigrator.prototype, "getMigrateData")
|
|
||||||
.resolves(MigrationUtils.resourceTypes.BOOKMARKS);
|
|
||||||
|
|
||||||
await withMigrationWizardDialog(async prefsWin => {
|
|
||||||
let dialogBody = prefsWin.document.body;
|
|
||||||
let wizard = dialogBody.querySelector("migration-wizard");
|
|
||||||
|
|
||||||
let shadow = wizard.openOrClosedShadowRoot;
|
|
||||||
|
|
||||||
info("Choosing Safari");
|
|
||||||
let panelItem = shadow.querySelector(
|
|
||||||
`panel-item[key="${SafariProfileMigrator.key}"]`
|
|
||||||
);
|
|
||||||
panelItem.click();
|
|
||||||
|
|
||||||
let resourceTypeList = shadow.querySelector("#resource-type-list");
|
|
||||||
|
|
||||||
// Let's make sure that PASSWORDS is displayed despite the migrator only
|
|
||||||
// (currently) returning BOOKMARKS as an available resource to migrate.
|
|
||||||
let passwordsNode = resourceTypeList.querySelector(
|
|
||||||
`label[data-resource-type="${MigrationWizardConstants.DISPLAYED_RESOURCE_TYPES.PASSWORDS}"]`
|
|
||||||
);
|
|
||||||
Assert.ok(
|
|
||||||
passwordsNode.hidden,
|
|
||||||
"PASSWORDS should not be available to import from."
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
await SpecialPowers.popPrefEnv();
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ const { MigrationWizardConstants } = ChromeUtils.importESModule(
|
|||||||
"chrome://browser/content/migration/migration-wizard-constants.mjs"
|
"chrome://browser/content/migration/migration-wizard-constants.mjs"
|
||||||
);
|
);
|
||||||
|
|
||||||
add_setup(async function () {
|
|
||||||
Services.prefs.setBoolPref("signon.management.page.fileImport.enabled", true);
|
|
||||||
registerCleanupFunction(() => {
|
|
||||||
Services.prefs.clearUserPref("signon.management.page.fileImport.enabled");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that the PasswordFileMigrator properly subclasses FileMigratorBase
|
* Tests that the PasswordFileMigrator properly subclasses FileMigratorBase
|
||||||
* and delegates to the LoginCSVImport module.
|
* and delegates to the LoginCSVImport module.
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ login-intro-description2 = All passwords you save to { -brand-product-name } are
|
|||||||
login-intro-instructions-fxa2 = Create or sign in to your account on the device where your logins are saved.
|
login-intro-instructions-fxa2 = Create or sign in to your account on the device where your logins are saved.
|
||||||
login-intro-instructions-fxa-settings = Go to Settings > Sync > Turn on syncing… Select the Logins and passwords checkbox.
|
login-intro-instructions-fxa-settings = Go to Settings > Sync > Turn on syncing… Select the Logins and passwords checkbox.
|
||||||
login-intro-instructions-fxa-passwords-help = Visit <a data-l10n-name="passwords-help-link">passwords support</a> for more help.
|
login-intro-instructions-fxa-passwords-help = Visit <a data-l10n-name="passwords-help-link">passwords support</a> for more help.
|
||||||
about-logins-intro-browser-only-import = If your logins are saved in another browser, you can <a data-l10n-name="import-link">import them into { -brand-product-name }</a>
|
|
||||||
about-logins-intro-import3 = Select the plus sign button above to add a password now. You can also <a data-l10n-name="import-browser-link">import passwords from another browser</a> or <a data-l10n-name="import-file-link">from a file</a>.
|
about-logins-intro-import3 = Select the plus sign button above to add a password now. You can also <a data-l10n-name="import-browser-link">import passwords from another browser</a> or <a data-l10n-name="import-file-link">from a file</a>.
|
||||||
|
|
||||||
## Login
|
## Login
|
||||||
|
|||||||
@@ -1398,18 +1398,6 @@ password-autocomplete:
|
|||||||
type: boolean
|
type: boolean
|
||||||
description: Enable direct migration?
|
description: Enable direct migration?
|
||||||
|
|
||||||
cm-csv-import:
|
|
||||||
description: Importing logins from CSV files
|
|
||||||
owner: issozi@mozilla.com
|
|
||||||
hasExposure: false
|
|
||||||
variables:
|
|
||||||
csvImport:
|
|
||||||
type: boolean
|
|
||||||
description: Can show CSV Import in about:logins or Migration Wizard
|
|
||||||
setPref:
|
|
||||||
branch: default
|
|
||||||
pref: "signon.management.page.fileImport.enabled"
|
|
||||||
|
|
||||||
# This feature flag mirrors the one used for ios
|
# This feature flag mirrors the one used for ios
|
||||||
# https://github.com/mozilla-mobile/firefox-ios/blob/main/nimbus-features/addressAutofillFeature.yaml
|
# https://github.com/mozilla-mobile/firefox-ios/blob/main/nimbus-features/addressAutofillFeature.yaml
|
||||||
address-autofill-feature:
|
address-autofill-feature:
|
||||||
|
|||||||
Reference in New Issue
Block a user