35

I am trying to use the new feature of chrome devtools "blackboxing a script".
This Chrome Devtools article lists script blackboxing functionality

What happens when you blackbox a script?

  • Exceptions thrown from library code will not pause (if Pause on exceptions is enabled)
  • Stepping into/out/over bypasses the library code
  • Event listener breakpoints don't break in library code
  • The debugger will not pause on any breakpoints set in library code.

The end result is you are debugging your application code instead of third party resources.

I have tried to blackbox the file directly by right clicking the file from source tab and everything goes right the yellow notification shows at the top of file "This script is blackboxed in debugger". Strangely none of the above listed points work, debugger goes through blackboxed script also event listeners reference the blackboxed script. I have also enabled Developer Tools experiments at chrome://flags/
With these options set i thought i would have been ok, i also have the latest chrome at this time 39.0 beta,i have no idea what i'm missing. Did anybody go through this?
Thnx!

enter image description here enter image description here

Herbi Shtini
  • 2,002
  • 29
  • 34
  • 1
    It has worked for me few times. But I noticed the same behavior on a script today. Weird – Germain Dec 03 '14 at 17:43
  • Having the same problem. Did you find a solution yet? – Antonio Brandao Jan 07 '16 at 15:59
  • 1
    I'm pretty sure something broke recently in Chrome – Simon_Weaver Feb 18 '16 at 23:47
  • @AntonioBrandao i could'nt find anything helpful, i lost interest and i just stopped using it – Herbi Shtini Feb 21 '16 at 21:51
  • Just tested it again and can confirm that it is still not working as expected on chrome 52 on Windows 7. The [documentation](https://developers.google.com/web/tools/chrome-devtools/debug/breakpoints/step-code#blackbox-third-party-code) has also moved. – TW80000 Aug 18 '16 at 00:18
  • There is an issue filed in chromium for this: https://bugs.chromium.org/p/chromium/issues/detail?id=589980&q=blackbox&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified – TW80000 Aug 19 '16 at 18:18

3 Answers3

2

I had the same issue. One quick and easy way is to look at your Call Stack. As a for instance, Right-Click on one of the 'jquery' functions and select 'black box' from the menu. Nothing else needed. In this example jquery.js will be step-over from that point on.

Gregg Burns
  • 186
  • 2
  • 5
1

In your screenshot, I can see a breakpoint.

If you put a breakpoint, it will always break (except if you deactivate it, of course), even with blackboxing being active.

avetisk
  • 11,651
  • 4
  • 24
  • 37
  • 1
    blackboxing works in my chrome, windows, 58.0.3029.110 (64-bit), colleague has the same machine and chrome version as me, but his blackboxing does not work, strange. it's such a useful feature. – Moika Turns Jun 26 '17 at 12:56
1

Had the same issue and used good old

have you tried turning it off and on again?

Go to developer tools settings -> Blackboxing -> Remove all entries one by one + disable Blackbox content scripts

Blackboxed again and after that this works fine.

Pavel Slepiankou
  • 3,516
  • 2
  • 25
  • 30