I’m working on a simple web interface that requires another web interface (that I don’t control) to be embedded, which unless someone has a better solution I’ve been serving via Apache reverse proxy to a sandboxed iframe.
The problem is, that web interface consists of a few frames of its own, and when I click a link in the navbar (<a href="main.htm" id="main.htm" target="main">LINKNAME</a>
) targeting the main content frame, it opens in a new tab. If I open the reverse proxy in its own tab everything runs fine, I’ve just been unable to figure out why it’s not working properly in the iframe. At this point my assumption is that the “main” target isn’t being recognized but I don’t know why (the “_self” targets in the top and main frames do work properly).
<frameset framespacing="0" border="0" frameborder="0" rows="54,*">
<frame name="top" noresize="" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" border="no" src="top.htm" target="_self">
<frameset cols="166,*">
<frame name="contents" target="main" src="navbar.htm" scrolling="auto" noresize="" marginwidth="5" marginheight="0">
<frame name="main" src="main.htm" scrolling="auto" noresize="" target="_self" marginwidth="0" marginheight="0">
</frameset>
</frameset>
I’ve noticed that I get "Unsafe attempt to initiate navigation for frame with URL 'http://.../main.htm' from frame with URL 'http://.../navbar.htm'. The frame attempting navigation is sandboxed, and is therefore disallowed from navigating its ancestors."
in the console when clicking the links but not sure if it directly relates to the problem. I don’t understand why it considers main.htm to be an ancestor, as they’re both at the same level of the site’s hierarchy. Either way, I’m unable to allow it out of the sandbox, as it will set itself as the top level document by way of if(top!=self){top.location.href=location.href}
.
Any thoughts?