mirror of https://github.com/gorhill/uBlock.git
[firefox] create key elements even if no shortcut assigned
This commit is contained in:
parent
7aab05f00a
commit
88cafba445
|
@ -3435,19 +3435,14 @@ vAPI.commands = (function() {
|
|||
|
||||
var myKey, shortcut, parts, modifiers, key;
|
||||
for ( var command of commands ) {
|
||||
modifiers = key = '';
|
||||
shortcut = vAPI.localStorage.getItem('shortcuts.' + command.id);
|
||||
if ( shortcut === null ) {
|
||||
vAPI.localStorage.setItem('shortcuts.' + command.id, '');
|
||||
} else if ( (parts = /^((?:[a-z]+-){1,})?(\w)$/.exec(shortcut)) !== null ) {
|
||||
modifiers = (parts[1] || '').slice(0, -1).replace(/-/g, ',');
|
||||
key = parts[2] || '';
|
||||
}
|
||||
if ( typeof shortcut !== 'string' ) { continue; }
|
||||
parts = /^((?:[a-z]+-){1,})?(\w)$/.exec(shortcut);
|
||||
if ( parts === null ) { continue; }
|
||||
modifiers = parts[1];
|
||||
if ( typeof modifiers === 'string' ) {
|
||||
modifiers = parts[1].slice(0, -1).split('-').join(' ');
|
||||
}
|
||||
key = parts[2];
|
||||
if ( typeof key !== 'string' ) { continue; }
|
||||
myKey = doc.createElement('key');
|
||||
myKey.setAttribute('id', 'uBlock0Key-' + command.id);
|
||||
if ( modifiers !== '' ) {
|
||||
|
|
Loading…
Reference in New Issue