简体   繁体   English

如何使用 Source Maps 在 Chrome 调试器中对文件进行黑箱处理?

[英]How to blackbox files in the Chrome debugger with Source Maps?

I am using Source Maps in JavaScript.我在 JavaScript 中使用Source Maps

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;即使我将库脚本黑盒化,Chrome 也会忽略黑盒化; this makes the step through debugger far less useful in many circumstances.这使得通过调试器的步骤在许多情况下变得不那么有用。

How can I use Source Map s in Chrome and have it actually black box as expected?如何在 Chrome 中使用Source Map并按预期让它实际上是黑盒子?

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有关更多信息,请参阅 chrome 错误: https : //bugs.chromium.org/p/chromium/issues/detail?id=583193

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."自 2020 年起,您只需右键单击数字所在的列并选择“将脚本添加到忽略列表”,即可在 Chrome 中黑盒化脚本。 Note that you can't just click anywhere in the file;请注意,您不能只单击文件中的任何位置; it must be in the column with the numbers.它必须在带有数字的列中。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM