mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Parse and propagate the iframe sandbox attribute
This commit is contained in:
committed by
Alexander Kalenik
parent
a5e2fd2e12
commit
40bb50ac60
Notes:
github-actions[bot]
2025-08-07 17:26:35 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/40bb50ac609 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5765
@@ -0,0 +1,34 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<script>
|
||||
async function no_cors_should_be_rejected() {
|
||||
let thrown = false;
|
||||
try {
|
||||
const resp = await fetch('top.txt');
|
||||
} catch (e) {
|
||||
thrown = true;
|
||||
}
|
||||
if (!thrown) {
|
||||
throw Error('fetching "top.txt" should be rejected.');
|
||||
}
|
||||
}
|
||||
|
||||
async function null_origin_should_be_accepted() {
|
||||
const url = 'top.txt?pipe=header(access-control-allow-origin,null)|' +
|
||||
'header(cache-control,no-store)';
|
||||
const resp = await fetch(url);
|
||||
}
|
||||
|
||||
async function test() {
|
||||
try {
|
||||
await no_cors_should_be_rejected();
|
||||
await null_origin_should_be_accepted();
|
||||
parent.postMessage('PASS', '*');
|
||||
} catch (e) {
|
||||
parent.postMessage(e.message, '*');
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user