1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 13:37:10 +09:00
ladybird/Tests/LibWeb/Text/input/navigation/iframe-navigate-javascript-url.html
Shannon Booth cdb249e058 LibWeb/HTML: Set a fetch client for javascript URL navigations
There is an open spec issue for this, and I'm certainly not sure
what the client should be here, but using the source snapshot
from the global from reading the spec issue seems like a reasonable
enough client for now.

This can be reproduced by performing a javascript URL navigation
with any CSP policy set. For simplicity, simply edit an existing
testcase to add such a policy.

Fixes: #4853
2025-05-23 16:39:13 +02:00

16 lines
591 B
HTML

<!DOCTYPE html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src javascript:;">
</head>
<script src="../include.js"></script>
<script>
asyncTest((done) => {
const iframe = document.querySelector("iframe");
iframe.addEventListener("load", () => {
println(iframe.contentWindow.document.body.innerText);
done();
});
iframe.src = "javascript:'<body>Hello from iframe navigated using javascript url</body>'";
});
</script>
<iframe src="about:blank"></iframe>