W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2015

Re: [whatwg] same origin iframe relative paths

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Mon, 01 Jun 2015 11:18:41 -0400
Message-ID: <556C77D1.5060304@mit.edu>
To: whatwg@lists.whatwg.org
On 6/1/15 4:49 AM, Aaron Polley (Union Square Software) wrote:
> I've recently been looking at embedding pages with the same origin however in the latest versions of browsers any script tags inside the iframe with relative urls are loaded relative to the parent page url rather than the iframe url.

That sounds quite odd, and doesn't match the behavior of any browser I'm 
aware of.

Do you happen to have a link to a page that shows the behavior you're 
describing?

> Does anyone know what the correct behaviour of the iframe should be in these circumstances?

The correct behavior is that relative URLs in an iframe use the base URL 
of the iframe, which is the document URL of the iframe unless there's a 
<base> tag or the document URL is about:srcdoc or about:blank or 
javascript:something (and possibly some complexity around iframes whose 
content was generated via document.open/write/close).

-Boris
Received on Monday, 1 June 2015 15:19:11 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:32 UTC