diff options
Diffstat (limited to 'browser/base/content/test/siteIdentity/test_web_controlled_blank.html')
-rw-r--r-- | browser/base/content/test/siteIdentity/test_web_controlled_blank.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/browser/base/content/test/siteIdentity/test_web_controlled_blank.html b/browser/base/content/test/siteIdentity/test_web_controlled_blank.html new file mode 100644 index 0000000000..35c1fd4ca2 --- /dev/null +++ b/browser/base/content/test/siteIdentity/test_web_controlled_blank.html @@ -0,0 +1,36 @@ +<!doctype html> +<html> + <head> + <title>Bug 1813463: Web controlled about:blank</title> + </head> + <!-- + This work is marked with CC0 1.0. To view a copy of this license, + visit http://creativecommons.org/publicdomain/zero/1.0 + --> + <body> + <p><a href="#" id="document_write">document.write example</a></p> + <p><a href="#" id="innerhtml">innerHTML example</a></p> + + <script> + document.getElementById("document_write").addEventListener("click", function (aEvent) { + aEvent.preventDefault(); + let popup = window.open("about:blank", "_blank", "width=800,height=600,popup"); + popup.document.write(` + <h1>check security info</h1> + <p>initial window.location = ${popup.location}</p> + <script> + document.write("<p>new window.location = " + window.location + "</p>") + <${"/"}script> + `); + }); + document.getElementById("innerhtml").addEventListener("click", function (aEvent) { + aEvent.preventDefault(); + let popup = window.open("about:blank", "_blank", "width=800,height=600,popup"); + popup.stop(); + popup.document.body.innerHTML = ` + <h1>check security info</h1> + <p>window.location = ${popup.location}</p>`; + }); + </script> + </body> +</html> |