Redirect parent window from an iframe action
window.top.location.href = "http://www.example.com";
As stated previously, will redirect the parent iframe.
I found that
<a href="..." target="_top">link</a> works too
window.top.location.href = "http://example.com";
window.top refers to the window object of the page at the top of the frames hierarchy.
or an alternative is the following (using document object)
parent.document.location.href = "http://example.com";
target="_parent" worked great for me. easy and hassle free!
@MIP is right, but with newer versions of Safari, you will need to add sandbox attribute(HTML5) to give redirect access to the iFrame. There are a few specific values that can be added with a space between them.
Reference(you will need to scroll):
<iframe sandbox="allow-top-navigation" src="http://google.com/"></iframe>