Created
April 30, 2019 00:05
-
-
Save Sawtaytoes/6655285274f8685eb34405fc08de232f to your computer and use it in GitHub Desktop.
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
/* Type the word "exit" in any point of your page... */ | |
(function () { | |
const sSecret = /* Choose your hidden word...: */ "exit"; | |
let nOffset = 0; | |
document.onkeypress = function(oPEvt) { | |
let oEvent = oPEvt || window.event, | |
nChr = oEvent.charCode, | |
sNodeType = oEvent.target.nodeName.toUpperCase(); | |
if (nChr === 0 || | |
oEvent.target.contentEditable.toUpperCase() === "TRUE" || | |
sNodeType === "TEXTAREA" || | |
sNodeType === "INPUT" && oEvent.target.type.toUpperCase() === "TEXT") { | |
return true; | |
} | |
if (nChr !== sSecret.charCodeAt(nOffset)) { | |
nOffset = nChr === sSecret.charCodeAt(0) ? 1 : 0; | |
} else if (nOffset < sSecret.length - 1) { | |
nOffset++; | |
} else { | |
nOffset = 0; | |
/* Do something here... */ | |
alert("Yesss!!!"); | |
location.assign("https://developer.mozilla.org/"); | |
} | |
return true; | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment