1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-03 09:39:38 +02:00

Support keyboard shortcut to open popup panel

Related discussion:
- https://www.reddit.com/r/uBlockOrigin/comments/dt47s0/
This commit is contained in:
Raymond Hill 2019-11-09 09:53:31 -05:00
parent 7bf5ac0ca2
commit e2fdc1b94b
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,8 @@
} }
}, },
"commands": { "commands": {
"_execute_browser_action": {
},
"launch-element-zapper": { "launch-element-zapper": {
"description": "__MSG_popupTipZapper__" "description": "__MSG_popupTipZapper__"
}, },

View File

@ -204,7 +204,12 @@
const template = document.querySelector('#templates .commandEntry'); const template = document.querySelector('#templates .commandEntry');
const tbody = document.querySelector('.commandEntries tbody'); const tbody = document.querySelector('.commandEntries tbody');
for ( const command of commands ) { for ( const command of commands ) {
if ( command.description === '' ) { continue; } if (
typeof command.description !== 'string' ||
command.description === '' )
{
continue;
}
const tr = template.cloneNode(true); const tr = template.cloneNode(true);
tr.setAttribute('data-name', command.name); tr.setAttribute('data-name', command.name);
tr.querySelector('.commandDesc').textContent = command.description; tr.querySelector('.commandDesc').textContent = command.description;