Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / Twilightify.js
Created June 17, 2013 00:30
Replace JavaScript errors on your page with Twilight Zone prologues. Errors from the console are unaffected.
var hasStartedEpisode = false;
window.onerror = function(e){
// credits roll
if(!hasStartedEpisode){
if(Math.random() > 0.5){
console.warn("You're traveling through another dimension.\nA dimension not only of sight and sound, but of mind.\nA journey into a wondrous land whose boundaries are that of imagination.\n--Your next stop: The Twilight Zone");
}
else{
console.warn("There is a fifth dimension, beyond that which is known to man.\nIt is a dimension as vast as space, and as timeless as infinity.\nIt is the middle ground between light and shadow - between science and superstition - and it lies between the pit of man's fears and the summit of his knowledge.\nThis is the dimension of imagination.\nIt is an area which we call: The Twilight Zone.\n");
}