简体   繁体   English

停止节点调试以打开新的浏览器窗口

[英]Stop node-debug from opening a new browser window

The command: 命令:

node-debug sls offline 

opens a new browser window every time it is run. 每次运行时都会打开一个新的浏览器窗口。

How do we stop it from opening a new window every time? 我们如何阻止它每次打开一个新窗口? I want to reuse the existing window! 我想重用现有的窗口!

This is a known issue with node inspector. 这是节点检查器的已知问题。 Take a look here . 看看这里

Since 0.9.0 we use https://github.com/benderjs/browser-launcher2 to start the browser, and make sure it's Chrome/Chromium/Opera (ie the browsers that can properly render node inspector; we detect installed browsers in the system and choose the most appropriate one; earlier we used opener module which just delegated opening the browser to the OS, which would open the defaul browser, which could have been eg Firefox) and this could be the reason why the behavior has changed. 从0.9.0开始,我们使用https://github.com/benderjs/browser-launcher2来启动浏览器,并确保它是Chrome / Chromium / Opera(即能够正确呈现节点检查器的浏览器;我们检测到已安装的浏览器)系统并选择最合适的一个;早些时候我们使用了刚开放浏览器的开启模块到操作系统,这将打开默认浏览器,这可能是例如Firefox),这可能是行为发生变化的原因。

browser-launcher2 actually does a bit more than just launching a browser, for instance it creates a new profile for Chrome in a subfolder of ~/ - this is probably the issue that @CalvinScott reported (ie Chrome that was opened was the new profile created by browser-launcher, not your original profile; you should be able to open your original profile of Chrome normally) browser-launcher2实际上不仅仅是启动浏览器,例如它在〜/的子文件夹中为Chrome创建了一个新的配置文件 - 这可能是@CalvinScott报告的问题(即打开的Chrome是创建的新配置文件通过浏览器启动器,而不是您的原始配置文件;您应该能够正常打开Chrome的原始配置文件)

Also, you may consider this : 另外,您可以考虑这个

Since version 6.3, Node.js provides a buit-in DevTools-based debugger which mostly deprecates Node Inspector, see eg this blog post to get started. 从版本6.3开始,Node.js提供了一个基于DevTools的buit-in调试器,它主要不赞成Node Inspector,请参阅此博客文章以开始使用。 The built-in debugger is developed directly by the V8/Chromium team and provides certain advanced features (eg long/async stack traces) that are too difficult to implement in Node Inspector. 内置调试器由V8 / Chromium团队直接开发,并提供某些高级功能(例如长/异步堆栈跟踪),这些功能在Node Inspector中难以实现。

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

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