重用/重新启动同一节点检查会话 [英] Reuse/restart the same node inspect session

查看:74
本文介绍了重用/重新启动同一节点检查会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦node.js程序在--inspect会话的上下文中运行完毕(即通过Chrome开发工具调试器),就可以重新启动它,而不必重新发出--inspect命令从命令行?

Once a node.js program has run to completion in the context of an --inspect session (i.e. via the Chrome dev tools debugger) is it possible to re-start it without having to re-issue the --inspect command from the command-line?

重新发出--inspect命令的问题在于,它每次都会生成一个不同的Chrome网址,然后每次都必须将其复制粘贴到Chrome中.理想情况下,我希望能够按F5重新启动chrome调试会话.

The issue with re-issuing an --inspect command is that it generates a different chrome url every time and one has to then copy-paste this into Chrome each time. Ideally I want to be able to push F5 to re-start the chrome debug session.

所以有两个问题:

  1. 我不能在不杀死当前进程的情况下重新启动调试会话(即无法刷新).
  2. 每次启动新会话时,我都必须将URL复制粘贴到chrome中. (不如问题1严重.)

推荐答案

为您提供了两个选项,尽管这两个选项都无法为您提供简单的F5刷新,但两者都比复制/粘贴由URL生成的新URL更好. --inspect标志.

Here's a couple of options for you, though neither will provide you with a simple F5 refresh, both are significantly better than copy/pasting the new URL generated by the --inspect flag.

最佳解决方案是为Chrome或Opera安装此扩展程序: https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

The most optimal solution is installing this extension for Chrome or Opera: https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

这将为您管理节点检查器.只需单击出现的工具栏图标,然后从切换开关中选择自动".每当您的节点服务器生成检查URL时,您的浏览器便会以检查模式打开Chrome DevTools.

This will manage the node inspector for you. Just click the resulting toolbar icon and select "Auto" from the toggle switch. Your browser will then open the Chrome DevTools in inspection mode whenever your node server generates an inspection URL.

如果您想采用技术含量较低(以及更多手册)的路线,或者不想安装Chrome扩展程序,只需将Chrome打开到"chrome://inspect",请稍等片刻,然后将在远程目标"下获得一个列表,其中将包括您的节点服务器.只需单击那里的检查"链接,DevTools将使用当前URL打开.这种方法的缺点是,每次服务器重新启动时,您都需要重新单击该检查"链接.它避免了复制/粘贴URL,但是仍然需要人工.

If you want to go the low-tech (and more manual) route, or don't want to install a Chrome extension, just open your Chrome to "chrome://inspect", wait a moment, and you'll get a list under Remote Target that will include your Node server. Just click the "inspect" link there, and the DevTools will open with the current URL. The downside of this method is you'll need to reclick that "inspect" link every time your server restarts. It avoids copy/pasting URLs, but still involves manual labor.

这篇关于重用/重新启动同一节点检查会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆