【问题标题】:Chrome Remote Debugger Get JS Input ValuesChrome 远程调试器获取 JS 输入值
【发布时间】:2019-02-18 16:02:55
【问题描述】:

我正在尝试使用节点模块“chrome-remote-interface”连接到 Google Chrome 调试端口。

我能够连接和拦截所有调试器消息,我可以在 Websocket 消息和返回值上看到我的函数,但我无法获取函数的输入参数。

例子:

{
    "callFrameId": "{\"ordinal\":0,\"injectedScriptId\":3}",
    "functionName": "capitalizeString",
    "functionLocation": {
        "scriptId": "74",
        "lineNumber": 25,
        "columnNumber": 25
    },
    "location": {
        "scriptId": "74",
        "lineNumber": 27,
        "columnNumber": 23
    },
    "url": "file:///test.html",
    "scopeChain": [
        {
            "type": "local",
            "object": {
                "type": "object",
                "className": "Object",
                "description": "Object",
                "objectId": "{\"injectedScriptId\":3,\"id\":55}"
            },
            "name": "capitalizeString",
            "startLocation": {
                "scriptId": "74",
                "lineNumber": 25,
                "columnNumber": 25
            },
            "endLocation": {
                "scriptId": "74",
                "lineNumber": 28,
                "columnNumber": 1
            }
        },
        {
            "type": "global",
            "object": {
                "type": "object",
                "className": "Window",
                "description": "Window",
                "objectId": "{\"injectedScriptId\":3,\"id\":56}"
            }
        }
    ],
    "this": {
        "type": "object",
        "className": "Window",
        "description": "Window",
        "objectId": "{\"injectedScriptId\":3,\"id\":57}"
    },
    "returnValue": {
        "type": "string",
        "value": "ANOMBRE"
    }
}

有人知道如何使用“chrome-remote-interface”获取 JS 函数的输入值吗?

【问题讨论】:

    标签: javascript node.js google-chrome-devtools


    【解决方案1】:

    解决了。我必须使用“Runtime.getProperties”来获得带有字段值的 Promise。

    【讨论】:

      猜你喜欢
      • 2018-12-22
      • 2014-06-24
      • 2015-06-18
      • 2018-05-31
      • 1970-01-01
      • 2013-12-28
      • 2014-06-13
      • 1970-01-01
      • 2018-03-30
      相关资源
      最近更新 更多