Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changes to data-uris security inheritance

12 views
Skip to first unread message

Patrick Brosset

unread,
Jul 12, 2017, 8:52:01 AM7/12/17
to dev-developer-tools
For information, the implementation of data-uris is changing in a way that
impacts a lot of DevTools mochitests.

The bug where the change is being done is 1324406
<https://bugzilla.mozilla.org/show_bug.cgi?id=1324406>.

The change is the following:
Previously, when you created an iFrame with its src attribute like
data:text/html,<some html> or similar, then the iFrame content window would
inherit the origin of the parent.
Now, the iFrame will be treated with its own origin, therefore accessing
the iFrame's content window from the parent won't be possible anymore.

The spec used to be unclear on this, and Firefox was the only browser to do
this. Now the spec has been changed, and we need to change Firefox to align
with it.

DevTools has lot's of tests that use iFrames and data-uris.
These tests are being fixed in bug 1377523
<https://bugzilla.mozilla.org/show_bug.cgi?id=1377523>.

So please keep this in mind for future code changes.
2 options:
- either load an actual external file instead of using a data-uri,
- or use the srcdoc attribute like:
<iframe src="<some html>"></iframe>
(note, no data:text/html, prefix)

Patrick
0 new messages