2

I am using Source Maps in JavaScript.

I put "debugger" in my code so that I could step through it but I end up down a very deep rabbit hole of library code and often give up. Even though I blackbox the library scripts, the blackboxing is ignored by Chrome; this makes the step through debugger far less useful in many circumstances.

How can I use Source Maps in Chrome and have it actually black box as expected?

8protons
  • 3,591
  • 5
  • 32
  • 67
Duke Dougal
  • 24,359
  • 31
  • 91
  • 123
  • 1
    For anyone else who did not know about [blackboxing scripts in Chrome](https://developer.chrome.com/devtools/docs/blackboxing) – Evan Davis Mar 25 '16 at 20:52
  • Are you saying that you have set up blackbox patterns for your sourcemaps, but Chrome ignores those patterns? Maybe post the configurations that are failing? – Evan Davis Mar 25 '16 at 20:55
  • @mathletics are you asking that because it works for you and you know it should work or stab in the dark? Which configuration exactly do you mean? My understanding is all I need is to put "debugger" in the code. – Duke Dougal Mar 25 '16 at 20:59
  • I repeat, _Are you saying that you have set up blackbox patterns for your sourcemaps, but Chrome ignores those patterns_? I don't understand what you did and why you think it should work. Do you think adding `debugger` to your code marks it as blackbox? (It doesn't.) – Evan Davis Mar 25 '16 at 21:00
  • No I have not set up patterns. To blackbox, I right click on the script and choose "Blackbox script". I repeat, are you asking that because it works for you and you know it should work or stab in the dark? – Duke Dougal Mar 25 '16 at 21:02
  • Stab in the dark. Are you marking a sourcemap as blackboxed? – Evan Davis Mar 25 '16 at 21:05
  • No I am marking the libraries as "blackbox script". If I blackbox my own files then presumably they (should) get skipped by the step through. – Duke Dougal Mar 25 '16 at 21:06
  • I'm voting to close this question as off-topic because it is already [an open issue in the Chrome Bugtracker](https://bugs.chromium.org/p/chromium/issues/detail?id=589980&q=blackbox&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified) – Evan Davis Mar 25 '16 at 21:18
  • In case that's not the right bug, here's another one that just says [Blackboxing is broken](https://bugs.chromium.org/p/chromium/issues/detail?id=538447&q=blackbox&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified) – Evan Davis Mar 25 '16 at 21:19
  • @mathletics thanks. "Because it's broken" seems to be the answer. – Duke Dougal Mar 25 '16 at 21:22
  • @DukeDougal I think the mentioned bug has been fixed now. I just checked and appears to be working in my case. – shriek Nov 02 '16 at 16:21

2 Answers2

2

It was not supported but is in the process of being added. For more info, see the chrome bug : https://bugs.chromium.org/p/chromium/issues/detail?id=583193

Luke Page
  • 8,136
  • 1
  • 20
  • 22
0

As of 2020, you can blackbox scripts in Chrome simply by right-clicking in the column where the numbers are and selecting "Add script to ignore list." Note that you can't just click anywhere in the file; it must be in the column with the numbers.

enter image description here

Andrew
  • 3,825
  • 4
  • 30
  • 44