0

do you know how to make website automatically reload when visitor open the dev tools/debugger/inspector?
I already use this javascript code:

var devtools = /./;
devtools.toString = function() {
  location.reload()
}

setInterval( () => {console.log('%c', devtools)} , 200 )

But it didn't work when i test it
Can you give me script to auto reload the website when visitor open the dev tools/inspector/debuuger until he close the dev tools/inspector/debuuger?
*I don't ask about how to remove inspect element

  • 1
    Possible duplicate of [Is it possible to remove "Inspect Element"?](https://stackoverflow.com/questions/28690564/is-it-possible-to-remove-inspect-element) – Abhishek Pandey Feb 04 '19 at 12:11
  • 1
    that duplicate has absolutely nothing to do with this question – Calvin Nunes Feb 04 '19 at 12:13
  • 1
    I asking about "auto reload website when visitor/someone open their dev tools/inspector", why you think i ask to remove the inspect element? – DhanaMerdeka Feb 04 '19 at 12:36
  • @CalvinNunes He can add `location.reload()` on those js `events`. right? – Abhishek Pandey Feb 04 '19 at 13:17
  • Which events? The above OP comment say it all why I think that the duplicate have nothing to do with the question – Calvin Nunes Feb 04 '19 at 13:26
  • This is what you want: https://sindresorhus.com/devtools-detect/ – imvain2 Feb 04 '19 at 22:45
  • And how to make my website auto reload when visitor open the dev tools with that script, i have no idea. – DhanaMerdeka Feb 04 '19 at 23:24
  • The snippet you've posted above works fine for me. Maybe give us some more context about your environment like OS, browser, browser version, etc. Also make sure there's no error logged in your dev tool's console. It might cause your browser abort the execution of the rest of your script. – Anticom Feb 05 '19 at 00:28
  • i try it on Chrome... 72.0.3626.81. what browser you used for test that? in me it not work.... :( – DhanaMerdeka Feb 05 '19 at 06:01

0 Answers0