gpt4 book ai didi

node.js - 阻止 Node 调试打开新的浏览器窗口

转载 作者:太空宇宙 更新时间:2023-11-04 02:05:41 26 4
gpt4 key购买 nike

命令:

node-debug sls offline 

每次运行时都会打开一个新的浏览器窗口。

我们如何阻止它每次都打开一个新窗口?我想重用现有的窗口!

最佳答案

这是 Node 检查器的一个已知问题。看看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 (i.e. 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 e.g. Firefox) and this could be the reason why the behavior has changed.

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 (i.e. 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)

此外,您可以考虑this :

Since version 6.3, Node.js provides a buit-in DevTools-based debugger which mostly deprecates Node Inspector, see e.g. this blog post to get started. The built-in debugger is developed directly by the V8/Chromium team and provides certain advanced features (e.g. long/async stack traces) that are too difficult to implement in Node Inspector.

关于node.js - 阻止 Node 调试打开新的浏览器窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44423438/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com