使用远程 shell 端口运行 chrome 会使 console.log 停止工作
如果我将以下行保存到 html 文件并在 chrome 中打开该文件,它就可以正常工作。
<script> console.log('hello') </script>
但是,如果您使用 --remote-shell-port=9222
运行 chrome,日志不会出现在控制台中。
有人知道解决方法吗?
If I save the following line to an html file and open the file in chrome, it works fine.
<script> console.log('hello') </script>
But if you run chrome with --remote-shell-port=9222
the log doesn't appear in the console.
Anybody know of a workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Remote-shell-port 标志公开了 V8 调试协议,该协议基本上
仅支持 V8 JavaScript 中提供的 JavaScript 调试功能
Chrome 中使用的引擎。控制台是浏览器的一个功能,V8 都知道
它与许多其他功能(包括 DOM 和网络检查)完全不同。
这是我们开发新的远程调试协议的原因之一
这也将涵盖其他领域。它正处于开发阶段并且
正在改变,但你可以尝试一下。请参阅文档:
http://code.google.com/chrome/devtools/docs/remote -调试.html
您尤其应该对控制台通知感兴趣:http:// code.google.com/chrome/devtools/docs/protocol/console.html#events
remote-shell-port flag exposes V8 debugging protocol which basically
supports only JavaScript debugging capabilities available in V8 JavaScript
engine used in Chrome. Console is a feature of the browser and V8 knows
nothing about it like many other features including DOM and Network inspection.
This one of the reasons we're working on a new remote debugging protocol
which will cover other domains as well. It is in development phase and
is changing but you can give it a try. See documentation at
http://code.google.com/chrome/devtools/docs/remote-debugging.html
In particular you should be interested in the console notifications: http://code.google.com/chrome/devtools/docs/protocol/console.html#events
虽然完全接受远程 shell 端口已被弃用,但我发现启动两个 chrome 实例(一个没有远程 shell 端口,一个带有远程 shell 端口),然后使用第一个实例是可行的。请注意,我发现顺序很重要,第二个使用远程 shell 端口启动实例...
While fully accepting that the remote-shell-port is deprecated, I found that starting two instances of chrome - one without the remote-shell-port and one with - and then working with the first instance works. Note that I found that the ordering was important, start the instance with the remote-shell-port second ...