[whatwg] links within an iframe cannot replace the parent document?

Constantine A. Murenin mureninc at gmail.com
Fri May 17 12:11:38 PDT 2013


I'm designing a deterministic URL shortener in nginx, now using HTML5
and iframes, and I got stuck with not being able to specify that all
links within the iframe referenced from my site, have to be opened up
by replacing my site.  (Obviously with the domain of the problem --
URL shortening -- I generally have no control over the URLs that are
loaded within the iframe.)

I've tried using <base target="_top">, and also a target="_parent" on
the iframe (which is not legal in HTML5, BTW), but to no avail.

I'd very much prefer not to use JavaScript (and even then, it's not
clear whether the same origin policies would even let me to), and I'd
also very much prefer not to confuse my users of where they are by
needlessly and endlessly squatting on the Location Bar.

What are my options?  Does HTML5 not supports any such flows?  I've
noticed there's a new `seamless` attribute, but, apart from still
being unsupported by many browsers, it seems to have some restrictions
in regards to same-origin, plus it's an all-or-nothing solution, and
I'm looking for something in the middle -- the iframe occupying most
of the screen (indeed in a seamless way, which is already possible
through CSS), plus links opening up such that they replace the parent
document.  Why HTML5 goes all or nothing instead?

On SO: http://stackoverflow.com/questions/16602378/make-links-within-an-iframe-replace-parent-document

Best regards,

More information about the whatwg mailing list