Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console only logs Buffer, not object #19

Open
slhck opened this issue Aug 22, 2022 · 0 comments
Open

Console only logs Buffer, not object #19

slhck opened this issue Aug 22, 2022 · 0 comments

Comments

@slhck
Copy link

slhck commented Aug 22, 2022

I am using this to call the Chrome devtools protocol like:

import WebSocket from 'ws';
import { Protocol } from 'devtools-protocol';
import type { ProtocolProxyApi } from 'devtools-protocol/types/protocol-proxy-api';
import { Client as RpcClient } from 'noice-json-rpc';

async function connect(websocketUrl: string) {
    const rpcClient = new RpcClient(new WebSocket(websocketUrl), { logConsole: true });
    const api: ProtocolProxyApi.ProtocolApi = rpcClient.api();
    const targets = await api.Target.getTargets({});
}

In the console I see:

Client > {"id":1,"method":"Target.getTargets","params":{}}
Client < <Buffer 7b 22 69 64 22 3a 31 2c 22 72 65 73 75 6c 74 22 3a 7b 22 74 61 72 67 65 74 49 6e 66 6f 73 22 3a 5b 7b 22 74 61 72 67 65 74 49 64 22 3a 22 44 30 38 44 ... 467 more bytes>

This is using Node v16.16.

Note that the targets value seems to be properly populated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant