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

Constantine A. Murenin mureninc at gmail.com
Tue May 28 12:35:37 PDT 2013

On 28 May 2013 10:22, Ian Hickson <ian at hixie.ch> wrote:
> On Fri, 17 May 2013, Constantine A. Murenin wrote:
>> 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.)
> Could you elaborate on your use case? What exactly is the effect you're
> trying to get? I'm not really understanding the step from "URL shortener"
> having an iframe.

The use-case is a deterministic URL shortener, where the user wants to
get access to certain information, which may be available via multiple
independent content providers (which are all known to the shortening

For example, right now, when someone requests
http://mdoc.su/-/ifconfig, I simply return a 300-Multiple-Choices
page, without actually loading any useful and readable content as an
appetizer.  What I might want to do instead is load one of the URLs in
a full-screen iframe (already possible through CSS, not possible with
HTML5 alone, since iframe's width/height must only contain pixel-based
values), and overlay my navigation that provides links to other
content providers with `z-index` (already possible through CSS), but
not squat on the Location bar (currently impossible not to squat on
the location bar).

Also, I think this is something that's useful for deterministic URL
shortening in many other cases, too:  say, when I enter
http://dx.doi.org/10.1109/ITCC.2005.129, it'd be useful if the URL
stays in the location bar, until I navigate away from the page that is
ultimately loaded.  Or, with a higher z-index, there might also be
other navigation, e.g. a link to
http://doi.ieeecomputersociety.org/10.1109/ITCC.2005.129, which is a
separate resource from the main IEEE Xplore that gets linked from
dx.doi.org, without such alternative ieeecomputersociety link being in
IEEE Xplore itself.  If an iframe had the semantics I am seeking for,
then, if needed, it'd be quite possible to accomplish such things; but
right now, none of them seem possible, supposedly not even with
JavaScript, since it'd be violating the same-origin principles.


More information about the whatwg mailing list