Created
February 15, 2018 11:34
-
-
Save RubaXa/dfa61059914da8f11b20265e1c314a41 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
const hasDevTools = (function () { | |
const ping = new Image(); | |
let devToolsOpened; | |
Object.defineProperty(ping, 'id', { | |
get() { devToolsOpened = true; } | |
}); | |
return function hasDevTools () { | |
devToolsOpened = false; | |
console.log('.%c', ping); | |
return devToolsOpened; | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment