Closed Rikk closed 3 years ago
It's not a feature of Waterfox 56.2.2.
uBlock Origin 1.16.15.5,
moz-extension://93e8ee82-ff37-41aa-905a-4de7d6747ff1/dashboard.html#shortcuts.html
This is what seems, but gorhill said it should work with FF60. Afaik, Waterfox implemented many things from FF60+, right? Perhaps not this?
References:
Some Mozilla bugs:
It's not a feature of Waterfox 56.2.2. …
Maybe that was wrong (sorry!) – I did no more than test the extension.
For Mozilla bug 1421811, https://github.com/MrAlex94/Waterfox/search?q=1421811&unscoped_q=1421811&type=Commits finds three commits, all tagged 56.2.0.
I wonder what determines whether the Shortcuts tab should appear.
https://robwu.nl/crxviewer/?crx=https%3A%2F%2Fgithub.com%2Fgorhill%2FuBlock%2Freleases%2Fdownload%2F1.16.15b6%2FuBlock0.firefox.signed.xpi led me to two chunks of code in particular.
µBlock.canUseShortcuts = vAPI.commands instanceof Object;
µBlock.canUpdateShortcuts = µBlock.canUseShortcuts &&
typeof vAPI.commands.update === 'function';
/******************************************************************************/
(function() {
if ( µBlock.canUseShortcuts === false ) { return; }
vAPI.commands.onCommand.addListener(function(command) {
var µb = µBlock;
switch ( command ) {
case 'launch-element-zapper':
case 'launch-element-picker':
vAPI.tabs.get(null, function(tab) {
if ( tab instanceof Object === false ) { return; }
µb.mouseEventRegister.x = µb.mouseEventRegister.y = -1;
µb.elementPickerExec(tab.id, undefined, command === 'launch-element-zapper');
});
break;
case 'launch-logger':
vAPI.tabs.get(null, function(tab) {
let hash = tab.url.startsWith(vAPI.getURL('')) ?
'' :
'#tab_active+' + tab.id;
µb.openNewTab({
url: 'logger-ui.html' + hash,
select: true,
index: -1
});
});
break;
default:
break;
}
});
})();
/******************************************************************************/
// Shortcuts pane
let getShortcuts = function(callback) {
if ( µb.canUseShortcuts === false ) {
return callback([]);
}
vAPI.commands.getAll(commands => {
let response = [];
for ( let command of commands ) {
let desc = command.description;
let match = /^__MSG_(.+?)__$/.exec(desc);
if ( match !== null ) {
desc = vAPI.i18n(match[1]);
}
if ( desc === '' ) { continue; }
command.description = desc;
response.push(command);
}
callback(response);
});
};
let setShortcut = function(details) {
if ( µb.canUpdateShortcuts === false ) { return; }
if ( details.shortcut === undefined ) {
vAPI.commands.reset(details.name);
µb.commandShortcuts.delete(details.name);
} else {
vAPI.commands.update({ name: details.name, shortcut: details.shortcut });
µb.commandShortcuts.set(details.name, details.shortcut);
}
vAPI.storage.set({ commandShortcuts: Array.from(µb.commandShortcuts) });
};
For Mozilla bug 1421811, https://github.com/MrAlex94/Waterfox/search?q=1421811&unscoped_q=1421811&type=Commits finds three commits, all tagged 56.2.0.
@MrAlex94 grafted all commits between Firefox 56 and Firefox 60 just before Waterfox 56.2.0, see https://github.com/MrAlex94/Waterfox/issues/553#issuecomment-388629097. Most of the merged commits do nothing in Waterfox. What has actually changed can only be seen by diffing pre- vs. post- merge commits.
@jbeich thanks! #553 was memorable but before today, I didn't realise the significance of the approach.
So there are still not keyboard shortcuts for Waterfox?
… keyboard shortcuts for Waterfox?
In Waterfox alpha:
@graham thanks, I don't have alpha, I guess I will wait until the current alpha becomes the stable version.
According to the uBlock author, it is needed "uBO 1.16.15b and Firefox 60+, the API needed to dynamically assign shortcuts (commands.update) became available with FF60."
Does Waterfox supports this API already?