简体   繁体   English

在chrome开发工具中隐藏Javascript注释?

[英]Hide Javascript comments in chrome dev tools?

I'm using chrome dev tools to debug and understand code from a javascript-based repo. 我正在使用chrome开发工具来调试和理解基于JavaScript的存储库中的代码。

I write down lots of inline comments on my forked repo. 我在分叉的仓库中写下了很多内联注释。 So I can jot down the insights I get during each debug iteration. 因此,我可以记下每次调试迭代期间获得的见解。 My forked repo is polluted with comments as a result. 我的分叉存储库被评论污染了。 It makes it a bit hard to read the source material in the debugger. 这使得在调试器中读取源材料有些困难。

What would be nice is if I could just "hide" javascript comments in chrome dev tools. 如果我可以在chrome dev工具中“隐藏” javascript注释,那将是很好的选择。

Does such a thing exist? 这样的事情存在吗? It seems like a feature the browser should be able to handle. 似乎浏览器应该能够处理的功能。 All I could find is the ability to hide html comments only. 我只能找到仅隐藏html注释的功能。

在此处输入图片说明

No, there is no way to do what you're asking. 不,您无法按照自己的要求去做。 The closest you could get is to have an automated task run over your JavaScript to actually remove the comments, but this would actually remove them, not just hide them visually. 您可以得到的最接近的结果是,在JavaScript上运行一个自动化任务以实际删除注释,但这实际上将删除它们,而不仅仅是视觉上隐藏它们。

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

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