1

How to disable console from running any script for all browsers for the website ?

Stephin
  • 55
  • 11
  • 1
    you can't. once the page is in the user's computer, he can modify your code as he wants – Dan Bizdadea Aug 08 '16 at 07:16
  • Related: http://stackoverflow.com/questions/14455692/disable-user-to-call-functions-from-console-in-web-browser?rq=1 http://stackoverflow.com/questions/18405614/disable-browser-console?noredirect=1&lq=1 – Thilo Aug 08 '16 at 07:21
  • Is there is any way i can get anything written in the console using js – Stephin Aug 08 '16 at 09:26

1 Answers1

4

Simple answer, you can't.

You have to make your client and server side code more robust in order to deal with erratic and unexpected user inputs.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
  • The basic line to draw in the sand here is : If all the user can mess with is his own experience, that's not really a problem, so don't go overboard. If the user can mess with other people's experience (including your business model) by tweaking his browser, that's a (security) problem in your application. – Thilo Aug 08 '16 at 07:19
  • I want my user to see the data I am showing to him , but not copy it . Currently he can do that using javascript only – Stephin Aug 08 '16 at 07:23
  • 1
    @StephinKBabu you can't prevent that I'm afraid. Any data you send to the browser can be retrieved and copied – Rory McCrossan Aug 08 '16 at 07:23
  • 1
    *"I want my user to see the data...but not copy it"* - Even if you could disable the browser's dev tools, if the user can see the data they can copy the details down by hand, or take a screenshot and run it through OCR, etc. – nnnnnn Aug 08 '16 at 07:46