繁体   English   中英

Chrome远程调试器获取JS输入值

[英]Chrome Remote Debugger Get JS Input Values

我正在尝试使用节点模块“ 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函数的输入值吗?

解决了。 我必须使用“ Runtime.getProperties”来获得该字段值的承诺。

暂无
暂无

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

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