Created
July 11, 2018 20:19
-
-
Save TimothyGu/0081e871ef0999eee03b46a550a74625 to your computer and use it in GitHub Desktop.
Firefox #1475000
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const http = require("http"); | |
const server = http.createServer((req, res) => { | |
if (req.url.includes("slow.js")) { | |
setTimeout(() => { | |
res.setHeader("Content-Type", "text/javascript"); | |
res.end("void 0;"); | |
}, 5000); | |
} else { | |
res.statusCode = 404; | |
res.setHeader("Content-Type", "text/plain"); | |
res.end("Not found"); | |
} | |
}); | |
server.listen(8888); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>This should get erased.</p> | |
<button onclick="document.open();">document.open()</button> | |
<script src="http://localhost:8888/slow.js"></script> | |
<script> | |
alert("You were too slow! Hit stop before this message."); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment