mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
[Pale-Moon] Issue #1744 - Add pref to ask for master password on application start.
This is a solution for some users having issues with multiple MP prompts due to either a race or asynchronously-triggered features that each need password database access (e.g. website login + sync) Based on Interlink's similar solution by Matt A. Tobin
This commit is contained in:
parent
f8c9d784db
commit
093f9b4f55
2 changed files with 25 additions and 0 deletions
|
|
@ -952,6 +952,9 @@ pref("browser.bookmarks.editDialog.showForNewBookmarks", false);
|
|||
// bookmarking dialog
|
||||
pref("browser.bookmarks.editDialog.firstEditField", "namePicker");
|
||||
|
||||
// Prompt for master password on application startup?
|
||||
pref("signon.startup.prompt", false);
|
||||
|
||||
// Whether to use a panel that looks like an OS X sheet for customization
|
||||
#ifdef XP_MACOSX
|
||||
pref("toolbar.customization.usesheet", true);
|
||||
|
|
@ -1065,6 +1068,7 @@ pref("services.sync.prefs.sync.security.default_personal_cert", true);
|
|||
pref("services.sync.prefs.sync.security.tls.version.min", true);
|
||||
pref("services.sync.prefs.sync.security.tls.version.max", true);
|
||||
pref("services.sync.prefs.sync.signon.rememberSignons", true);
|
||||
pref("services.sync.prefs.sync.signon.startup.prompt", true);
|
||||
pref("services.sync.prefs.sync.spellchecker.dictionary", true);
|
||||
pref("services.sync.prefs.sync.xpinstall.whitelist.required", true);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@ BrowserGlue.prototype = {
|
|||
break;
|
||||
case "profile-after-change":
|
||||
this._onProfileAfterChange();
|
||||
this._promptForMasterPassword();
|
||||
break;
|
||||
case "browser-search-engine-modified":
|
||||
if (data != "engine-default" && data != "engine-current") {
|
||||
|
|
@ -409,6 +410,26 @@ BrowserGlue.prototype = {
|
|||
{
|
||||
this._copyDefaultProfileFiles();
|
||||
},
|
||||
|
||||
_promptForMasterPassword: function() {
|
||||
if (!Services.prefs.getBoolPref("signon.startup.prompt", false))
|
||||
return;
|
||||
|
||||
// Try to avoid the multiple master password prompts on startup scenario
|
||||
// by prompting for the master password upfront.
|
||||
let token = Components.classes["@mozilla.org/security/pk11tokendb;1"]
|
||||
.getService(Components.interfaces.nsIPK11TokenDB)
|
||||
.getInternalKeyToken();
|
||||
|
||||
// Only log in to the internal token if it is already initialized,
|
||||
// otherwise we get a "Change Master Password" dialog.
|
||||
try {
|
||||
if (!token.needsUserInit)
|
||||
token.login(false);
|
||||
} catch (ex) {
|
||||
// If user cancels an exception is expected.
|
||||
}
|
||||
},
|
||||
|
||||
_onAppDefaults: function() {
|
||||
// apply distribution customizations (prefs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue