puppeteer/test/assets/abort-request.html

14 lines
330 B
HTML

<!DOCTYPE html>
<button id="abort"></button>
<script>
const button = document.getElementById('abort');
button.addEventListener('click', getJson)
async function getJson() {
const abort = new AbortController();
const result = fetch("/simple.json", {
signal: abort.signal
});
abort.abort();
}
</script>