mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 17:36:34 +00:00
chore: Enable keyboard shortcuts in Zen browser settings
This commit is contained in:
@@ -62,6 +62,28 @@ var gZenCKSSettings = {
|
||||
this._currentAction = null;
|
||||
this._initializeEvents();
|
||||
this._initializeCKS();
|
||||
this._addPrefObservers();
|
||||
},
|
||||
|
||||
_addPrefObservers() {
|
||||
Services.prefs.addObserver("zen.keyboard.shortcuts.disable-firefox", this.onDisableFirefoxShortcutsChange.bind(this));
|
||||
},
|
||||
|
||||
async onDisableFirefoxShortcutsChange(event) {
|
||||
let checked = Services.prefs.getBoolPref("zen.keyboard.shortcuts.disable-firefox");
|
||||
if (checked) return;
|
||||
let buttonIndex = await confirmRestartPrompt(
|
||||
true,
|
||||
1,
|
||||
true,
|
||||
false
|
||||
);
|
||||
if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) {
|
||||
Services.startup.quit(
|
||||
Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
|
||||
);
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
_initializeCKS() {
|
||||
@@ -228,5 +250,10 @@ Preferences.addAll([
|
||||
id: "zen.theme.floating-urlbar",
|
||||
type: "bool",
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
id: "zen.keyboard.shortcuts.disable-firefox",
|
||||
type: "bool",
|
||||
default: false,
|
||||
}
|
||||
]);
|
||||
|
Reference in New Issue
Block a user