How to use `click` in a shortcut? (Run a service when clicking a link)
BetterTouchTool
You can use better touch tool to remap your clicks on your trackpad or mouse. Here is a screenshot of the rule I created. It copies the url from the hyperlink and sends this to a shell script, where you can handle it as you wish.

The last line actions, &quot;Execute Shell Script&quot; has this configuration:

This just runs an executable script and pastes in the url as its argument. If you don't want to use a bash/zsh script you can use applescript or javascript or python or perl or whatever you are comfortable with by changing the launch path.