我正在尝试使用节点模块“ 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函数的输入值吗?
答案 0 :(得分:0)
已解决。我必须使用“ Runtime.getProperties”来获得带有该字段值的Promise。