Add a missing check to ensure the clicked element is or is inside a link.
Add non-index.html link support as well as command/ctrl click consideration.