Opening new unsandboxed tab from sandboxed iframe

776 views Asked by At

Is it possible to open a new tab, from a sandboxed iframe, into a new browsing context?

Let's consider main.html, having the following iframe: <iframe src="iframe.html" sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts allow-popups" />

And iframe.html, having a link <a target="_blank" href="otherpage.html">Link</a>

When the link is clicked from main.html, otherpage.html is be opened into a sandboxed context, so that any navigation driven in Javascript would hit the following error: Unsafe JavaScript attempt to initiate navigation for frame with URL

But when the link has target="_top", otherpage.html is allowed to perform Javascript driven navigation.

I found this is the standard behavior (from http://dev.w3.org/html5/spec-preview/browsers.html)

When the allow-top-navigation is set, content can navigate its top-level browsing context, but other browsing contexts are still protected by the sandboxed navigation browsing context flag

QUESTION: so, in a situation where one is not at liberty to change both main.html nor otherpage.html, is it possible to have the link opened into a unsandboxed new tab?

A concrete example: main.html is generated by GoogleSite and otherpage in a BusinessObject report (via OpenDocument)

0

There are 0 answers