Firefox - Disable 'debugger' keywords

后端 未结 4 711
滥情空心
滥情空心 2020-12-29 06:57

How do I tell Firefox not to stop if it sees a debugger keyword?

I need to avoid a continuous debugger loop in case the website uses debugg

相关标签:
4条回答
  • 2020-12-29 07:40

    if you use Greasemonkey you can rewrite setTimeout/setInterval function to disable the script

    unsafeWindow.setTimeout = function () {};
    
    0 讨论(0)
  • 2020-12-29 07:40

    in chrome you can edit the breakpoint and put a condition that is always false, it won't hit the debugger anymore

    another option is to use "never pause here"

    for firefox, you can blackbox the script that you don't want to be hit by the breakpoint. for me it causes to hang the firefox. but when you restart the browser. then it's okay,

    0 讨论(0)
  • 2020-12-29 07:43

    Obviously the page tries to avoid people from debugging their JavaScript code with that construct.

    Debugging in Firebug

    Firebug allows to set disabled breakpoints on the debugger statements. Because the page generates a variable call stack depth, you'll need to set those disabled breakpoints for all of them to be able to debug the JavaScript properly. Unfortunately, Firebug seems to be buggy when it comes to set those breakpoints.

    Furthermore, Firebug doesn't have an option to ignore all debugger statements.

    So, if you don't need to debug JavaScript but only HTML, CSS, network requests, etc., you can simply disable the Script panel to avoid these annoying debugger halts. To do so, right-click the Script tab and click on Enable within the opening menu.

    Note: Because Firebug development is discontinued, it's useless to file an enhancement request for it.

    Debugging in Firefox DevTools

    Unfortunately, the Firefox DevTools currently don't allow to avoid halting on debugger statements. So you have to wait until bug 1300934 (which mentions the same website as an example), bug 925269 and/or issue 828 are fixed.

    Furthermore there is no way to disable the Debugger panel completely, which is filed as bug 1247198.

    0 讨论(0)
  • 2020-12-29 07:59

    In the current version of Firefox at writing this answer (ver 63.0.3), in the Developer Tools, the Debugger section, there's an icon with the tooltip "Skip all pausing" or "Deactivate breakpoints". When enabled it seems to disable stopping at any debugger instruction.

    0 讨论(0)
提交回复
热议问题