Consider this web page: <iframe></iframe> <script> onload = function() { var doc = frames[0].document; doc.body.innerHTML = '<a href=""></a>' alert("Document base URI: " + doc.baseURI); alert("Anchor base URI: " + doc.querySelector('a').baseURI); alert("Anchor href: " + doc.querySelector('a').href); } </script> This should alert the URI of the web page three times. In Safari it instead alerts "about:blank", "null", and the URI of the web page, respectively.
A live demo of this is available at http://jsfiddle.net/n0gdh5y4/5/
Here are updated test results across all browsers (using test case from Comment 01): *** Safari 15.6 on macOS 12.5 *** JSFiddle changed to "show": Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ JSFiddle with "show" in URL (not Standalone but Editor mode): Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= *** Chrome Canary 106 *** Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= *** Firefox Nightly 105 *** Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/light/ Document base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor base URI: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= Anchor href: https://fiddle.jshell.net/n0gdh5y4/5/show/?editor_console= _______________ I think it was fixed along the way since, I don't see any "about:blank", "null" etc. as mentioned from Comment 0. I think this can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!
Nice. Thanks for testing!