Scene . I am writing an embedded widget. It takes the form of a tag <script>that builds an iframe containing everything you need to display. There is no in the iframe src, but the script is written to it using theIframe.contentWindow.document.write(). This holds the widget and keeps the identifiers of the elements and script from conflict with the page on which the widget is embedded.
Trick . The widget should be able to resize. To do this, he installs his iframe style.height. This requires access to the external DOM page. In Firefox and IE, this is allowed since it is believed that the iframe document and the external document share the beginning.
Twist : In Safari , however, both documents are considered non-distributed. The internal document is considered equal about:blank, while the external document explicitly uses a different protocol and "domain" (if blankyou can consider it a domain).
Question . How can I create iframe code whose Safari / WebKit document will have the same origin as the window document creating it?
Change . After further experimentation, I cannot find a way to programmatically create an iframe whose location is not about:blank, regardless of whether I am changing its contents.
document.createElement(), src, HTML , "foo.html", document.body.appendChild() , Safari DOM, , "about: blank".
HTML iframe , foo.html, "foo.html".
HTML document.write(), , document.body.appendChild().
Firefox.