From e2fdc1b94bee06da77fa45a59395cb7cedfa61ae Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 9 Nov 2019 09:53:31 -0500 Subject: [PATCH] Support keyboard shortcut to open popup panel Related discussion: - https://www.reddit.com/r/uBlockOrigin/comments/dt47s0/ --- platform/firefox/manifest.json | 2 ++ src/js/shortcuts.js | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/firefox/manifest.json b/platform/firefox/manifest.json index ccdc3e6fe..09416b5d6 100644 --- a/platform/firefox/manifest.json +++ b/platform/firefox/manifest.json @@ -19,6 +19,8 @@ } }, "commands": { + "_execute_browser_action": { + }, "launch-element-zapper": { "description": "__MSG_popupTipZapper__" }, diff --git a/src/js/shortcuts.js b/src/js/shortcuts.js index 8741f8d94..4c1ad766d 100644 --- a/src/js/shortcuts.js +++ b/src/js/shortcuts.js @@ -204,7 +204,12 @@ const template = document.querySelector('#templates .commandEntry'); const tbody = document.querySelector('.commandEntries tbody'); for ( const command of commands ) { - if ( command.description === '' ) { continue; } + if ( + typeof command.description !== 'string' || + command.description === '' ) + { + continue; + } const tr = template.cloneNode(true); tr.setAttribute('data-name', command.name); tr.querySelector('.commandDesc').textContent = command.description;