Link under cursor condition?

I'd like to have a conditional that does different things if the hovered text is a link or just plain text. A potential way to do this would be to see if the context menu has the option "Open link", but I don't know how to do that either. Any thoughts?