Hook into link click event?

Hi,

I know it’s possible to hook into opening a file by using the active-leaf-change or file-open workspace events. However, those events do not indicate whether the file was opened via a link (and if so, which link).

I’d like to know if there’s a possibility to hook into a link click event and get the link’s destination file and a possible alias text as parameters. The whole reason for this question is the ability to get the alias text, which cannot be accessed via active-leaf-change or file-open events, afaik.

Optionally prevent opening the file

An extra nice feature could also be the ability to cancel opening the file in Obsidian, e.g. by returning a flag that would tell Obsidian if it can continue opening the file or not. This could be used for example to open certain links in an external application, in which case there is no need to open the same file in Obsidian anymore.

Thank you for your support! :slightly_smiling_face:

2 Likes