Merge pull request #2524 from keepassxreboot/feature/add_support_for_firefox_shortcuts_page

Add support for opening Firefox shortcut settings page
This commit is contained in:
Sami Vänttinen 2025-04-21 14:07:37 +03:00 committed by GitHub
commit dccf307e0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -200,9 +200,21 @@ options.initGeneralSettings = async function() {
});
$('#configureCommands').addEventListener('click', function() {
if (isFirefox()) {
if (typeof(browser.commands.openShortcutSettings) === 'function') {
browser.commands.openShortcutSettings();
} else {
// TODO: Remove internal shortcuts page after Firefox ESR has support for openShortcutSettings()
browser.tabs.create({
url: browser.runtime.getURL('options/shortcuts.html')
});
}
return;
}
const scheme = isEdge() ? 'edge' : 'chrome';
browser.tabs.create({
url: isFirefox() ? browser.runtime.getURL('options/shortcuts.html') : `${scheme}://extensions/shortcuts`
url: `${scheme}://extensions/shortcuts`
});
});