mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
23 lines
702 B
HTML
23 lines
702 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
let testCounter = 1;
|
|
function testPart(part) {
|
|
try {
|
|
println(`${testCounter}. ${JSON.stringify(part())}`);
|
|
} catch (e) {
|
|
println(`${testCounter}. Exception: ${e.name}`);
|
|
}
|
|
testCounter++;
|
|
}
|
|
|
|
// 1. Send beacon
|
|
testPart(() => navigator.sendBeacon('https://example.com/') == true);
|
|
|
|
// 2. Send beacon with wrong URL
|
|
testPart(() => navigator.sendBeacon('dsfhdsaklfhdasklf'));
|
|
|
|
// 3. Send beacon with wrong scheme
|
|
testPart(() => navigator.sendBeacon('wss://example.com/'));
|
|
});
|
|
</script>
|