tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit e1b32205a70e8f61a5afcb3c0e3ca311fb5870a0
parent 0a90cff0500369bd547f08d06656b3e84894a882
Author: Anne van Kesteren <annevk@annevk.nl>
Date:   Sat, 22 Nov 2025 21:12:44 +0000

Bug 2001566 [wpt PR 56179] - HTML: refresh to javascript: URL, a=testonly

Automatic update from web-platform-tests
HTML: refresh to javascript: URL

For https://github.com/whatwg/html/pull/11700.
--

wpt-commits: e56b7e7686960931a42e3b54427c3905393f2118
wpt-pr: 56179

Diffstat:
Atesting/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/javascript.window.js | 15+++++++++++++++
Atesting/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/javascript.asis | 7+++++++
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/javascript.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/javascript.window.js @@ -0,0 +1,15 @@ +async_test(t => { + const frame = document.createElement("iframe"); + t.add_cleanup(() => frame.remove()); + const path = "resources/javascript.asis"; + frame.src = path; + frame.onload = t.step_func(() => { + assert_equals(frame.contentWindow.location.href, new URL(path, self.location).href); + assert_equals(frame.contentWindow.x, 1); + t.step_timeout(() => { + assert_equals(frame.contentWindow.x, 1); + t.done(); + }, 100); + }); + document.body.appendChild(frame); +}, "Refresh to a javascript: URL should not work"); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/javascript.asis b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/javascript.asis @@ -0,0 +1,7 @@ +HTTP/1.1 200 OK +Refresh: 0,javascript:x=2 +Content-Type:text/html + +I don't understand. +<meta http-equiv=refresh content=0;javascript:x=3/> +<script>x=1</script>