theajack / disable-devtool

Disable web developer tools from the f12 button, right-click and browser menu
https://theajack.github.io/disable-devtool/
MIT License
1.78k stars 169 forks source link

[Just for Discussion] If re-define the console object, currently the tool cannot be practiced as the expected #69

Open JerryWenlong opened 1 year ago

JerryWenlong commented 1 year ago

Well, this is just for discussion. The tool is amazing!

I research out that it relaies on the Console object, so here 's an unexpected scenarrio:

(I use Chrome)

The Steps:

  1. Open the browser (Chrome).
  2. Open the dev-tool firstly before we open the website.
  3. Click 'Sources' Tab, find the 'Event Listener Breakpoints' selectors on the right panel.
  4. Checked 'Script' - 'Script First Statement'
  5. Then we inject a scripts in the console drawer like:
    Object.defineProperty(window, 'console', {
    value: {
    table: () => {},
    log: () => {},
    clear: () => {},
    debug: () => {},
    warn:() => {}
    }
    });
  6. Then unchecked the 'Script' and resume the script running.

    Hope we may find a way~

theajack commented 11 months ago

Thank you for your issue, but if the function of disable-devtool takes effect as expected, then others will not have the opportunity to redefine the console in the console.

However, there are still many solutions to bypass the restrictions of disable-devtool, such as disabling js, network packet capture, and using browser plug-ins to inject scripts. This is a limitation of web applications. We can only prevent it as much as possible.

@JerryWenlong