I'm working on a web app where I have two anchor tags inside an iframe with the same domain as the parent:
<iframe src="same_domain_as_parent">
<a href="google.com" target="hello">Go to google</a>
<a href="youtube.com" target="hello">Go to youtube</a>
</iframe>
What I would like is to have both links inside the iframe open in the same tab, even after the parent windows has been reloaded. Just like they would behave outside of the iframe.
The behaviour now:
Clicking on google-link opens google.com in a new tab
Clicking on youtube-link opens youtube.com in the same tab as 1.
Refresh parent window
Clicking on google-link opens google.com in a new tab
What I would like:
Clicking on google-link opens google.com in a new tab
Clicking on youtube-link opens youtube.com in the same tab as 1.
Refresh parent window
Clicking on google-link opens google.com in the same tab as 1. and 2.
It seems that when refreshing the parent window, the context (?) of the iframe resets and links opens in a new tab. This isn't the case for anchor tags in the parent window, which still targets the same tab even after refresh. How can I achieve this within the iframe as well?