LibWeb: Implement FetchController::abort()

This commit is contained in:
Kenneth Myhra 2024-11-22 12:30:16 +01:00 committed by Andreas Kling
commit 968c38e54f
Notes: github-actions[bot] 2024-11-24 10:12:37 +00:00
4 changed files with 34 additions and 4 deletions

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
const runAbortController = ((reason) => {
let controller = new AbortController();
let signal = controller.signal;
fetch('data:text/plain,fetched from far', { signal })
.catch(err => {
println(err);
});
controller.abort(reason);
});
runAbortController(undefined);
runAbortController("Abort with a reason");
});
</script>