So it turns out I'm also a Windrunner (cool!) - but boy-oh-boy, that copy protection code on his site is aggressive.
All code snippets from the site
First, it blocks all ordinary means of opening the developer tools (in addition to blocking right-click):
document.addEventListener("contextmenu", function(e) {
e.preventDefault();
}, false);
document.addEventListener("keydown", function(e) {
// "I" key
if (e.ctrlKey && e.shiftKey && e.keyCode == 73) {
disabledEvent(e);
}
// "J" key
if (e.ctrlKey && e.shiftKey && e.keyCode == 74) {
disabledEvent(e);
}
// "S" key + macOS
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
disabledEvent(e);
}
// "U" key
if (e.ctrlKey && e.keyCode == 85) {
disabledEvent(e);
}
// "F12" key
if (event.keyCode == 123) {
disabledEvent(e);
}
}, false);
function disabledEvent(e) {
if (e.stopPropagation) {
e.stopPropagation();
} else if (window.event) {
window.event.cancelBubble = true;
}
e.preventDefault();
return false;
}
Then, if you choose to go in with JS disabled it boots you immediately to the 404 page (so you have to ignore this noscript
block if you want to view his website with a non-JS-enabled browser):
<noscript>
<meta http-equiv="refresh" content="0; url=/404">
</noscript>
Then comes the clever-but-obnoxious part. If you come in with the browser tools open in a separate window it still detects that you've got it open with this one nifty trick :
var SwiftNinjaProBlockConsoleDetectedSpeedChange = false;
var SwiftNinjaProBlockConsoleDetectedResize = false;
var SwiftNinjaProBlockConsoleInFirstLoad = false;
// Create a new image
var element = new Image;
var SwiftNinjaProBlockConsoledevtoolsOpen = false;
// Watch for anything that tries to access the `id` attribute
element.__defineGetter__("id", function() {
SwiftNinjaProBlockConsoledevtoolsOpen = true;
SwiftNinjaProBlockConsoleDetectedSpeedChange = true;
// And blow them away if it is accessed
SwiftNinjaProBlockConsoleClearAll();
});
setInterval(function() {
SwiftNinjaProBlockConsoledevtoolsOpen = false;
// AND FINALLY, CHECK TO SEE IF THEY'RE WATCHING
console.log(element);
setTimeout(function(){
console.clear();
SwiftNinjaProBlockConsoleClearAll();
}, 10);
}, 100);
// This, on the other hand is just evil
// if I resize my *browser window* I will get a 404 ... that's frustrating
window.onresize = function(){
SwiftNinjaProBlockConsoleDetectedResize = true;
SwiftNinjaProBlockConsoleClearAll();
}
// Hide how you did it from leet haxxoors
function SwiftNinjaProBlockConsoleClearAll(){
var shouldClear = false;
if(SwiftNinjaProBlockConsoleDetectedResize && SwiftNinjaProBlockConsoleDetectedSpeedChange){
shouldClear = true;
}else if(SwiftNinjaProBlockConsoleInFirstLoad && SwiftNinjaProBlockConsoleDetectedSpeedChange){
shouldClear = true;
}
if(shouldClear){
console.log('The code for this website has self destructed in your browser for protection from hackers bacause you opened the console. Have a nice day :D');
console.log('Please close the console, and go back to the previous page.');
document.getElementsByTagName("html")[0].remove();
window.open('/404', '_self');
}
}