I'm currently exploring ways to use vanilla JavaScript in order to display all external links - particularly those that typically open in a new tab or window - within a modal box instead.
My goal is to implement a listener on external links (those not targeted for the same window) and redirect them to my modal box rather than opening a new window.
I am hoping to achieve this functionality without distinguishing between whether the link opens in a new window/tab via a _blank anchor or other method, such as JavaScript-generated popups.
I appreciate any assistance you can provide on this issue. Thank you!