I'm new to Html and Javascript. I've been making an iframe browser with the help of an extension. see my GitHub page One of the issues my users face is that some links and redirects that occur in the iframe open in a new tab. How do I prevent this and allow the redirects and links(when clicked on) to open in the iframe? If not possible, is there a way to get the URL of the link before the page is redirected?
I tried adding <base target="_self"> in the head of the page.