- Edited
Although the Zotero extension has no internal way to map shortcuts:
Chrome provides this window to allow for extension activation:
By default, as you can see, no mapping is configured. Just the option to do so.
Although the Zotero extension has no internal way to map shortcuts:
Chrome provides this window to allow for extension activation:
By default, as you can see, no mapping is configured. Just the option to do so.
Some browser extensions can be activated by keyboard shortcut, however many cannot. It depends on each individual extension. Take, for example, Zotero: This extension has one function (extract metadata from current page and save to the main Zotero application), which can be activated only by clicking on the extension icon.
I find the click-only approach to be unergonomic, especially if the extension is hidden in the overflow menu. (Sometimes I might be activating the Zotero extension 10 or 15 times in quick succession, and I suffer from RSI...) Chromium browsers offer such key mapping capability for most/all extensions. In Safari, UI scripting is required.
My suggestion is that Orion should add Tools > Extensions > [name of extension] > Activate
to the application menu for each extension, with Activate effectively simulating a left click on the extension icon. This could then be mapped to keyboard shortcut using the system keyboard shortcut settings, or with a third party app such as Keyboard Maestro.
+1 This is one of the silliest limitations of Safari and it'd be great for Orion to improve upon it.
Orion wouldn’t need to know what mappings are used by extensions.
Let me give an example of what I'm talking about. The Zotero extension has one function (extract metadata from current page and save to the main Zotero application), which is activated by clicking on the extension icon. Unlike some similar extensions, it offers no way to map this to a keyboard shortcut.
I find the click-only approach to be unergonomic, especially if the extension is hidden in the overflow menu. (Sometimes I might be activating the Zotero extension 10 or 15 times in quick succession, and I suffer from RSI...) Chromium browsers offer such key mapping capability for most/all extensions. In Safari, as mentioned above, UI scripting is required.
What I am suggesting is that all that is needed for Orion is to have Tools > Extensions > [name of extension] > Activate
in the application menu for each extension, with Activate
simulating a click on the extension icon. For some extensions, this wouldn’t do anything useful, but for the likes of Zotero it would be very useful.
So, Orion wouldn’t need to know anything more about extension shortcuts than it already does. It would obviously be up to the user to avoid mapping clashes, same as with remapping any menu item.
+1 for using system keyboard shortcut remapping for Orion's own shortcuts. Best to use existing facilities where they exist.
However, the problem is with extensions. Not all extensions offer keyboard shortcut mapping. In Safari, the only way to map such shortcuts is laggy, complicated, and fragile UI scripting, like this:
on clickSafariToolbarButton(buttonName)
tell application "System Events"
tell application process "Safari" to tell its first window to tell toolbar 1
set theElements to UI element 1 of every group
set theElements to reverse of theElements -- working right to left
repeat with eachButton in theElements
if description of eachButton is buttonName then click eachButton
end repeat
end tell
end tell
end clickSafariToolbarButton
Something like this would also work for Orion, but its more of a workaround than a good solution.
A better solution might be where in Tools > Extensions > [name of extension >
there are menu items for Disable
and Options
, there could also be a menu item for Activate
—i.e. to react as if the extension's toolbar button was clicked (ideally, even if it is hidden in the overflow menu). This menu could then be mapped via system preferences, the same as the rest.