We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26846c9 commit a762af1Copy full SHA for a762af1
1 file changed
extensions/browser/src/browser/chrome.internal.test.ts
@@ -158,9 +158,20 @@ async function withMockChromeCdpServer(params: {
158
} else {
159
wss.on("connection", (ws) => {
160
ws.on("message", (raw) => {
161
- const msg = JSON.parse(rawDataToString(raw)) as { id?: number };
162
- if (msg.id === 1) {
163
- ws.send(JSON.stringify({ id: 1, result: { product: "Chrome/Mock" } }));
+ const message = JSON.parse(rawDataToString(raw)) as {
+ id?: unknown;
+ method?: unknown;
164
+ };
165
+ if (message.method === "Browser.getVersion" && typeof message.id === "number") {
166
+ ws.send(
167
+ JSON.stringify({
168
+ id: message.id,
169
+ result: {
170
+ product: "Chrome/Mock",
171
+ userAgent: "OpenClawTest",
172
+ },
173
+ }),
174
+ );
175
}
176
});
177
0 commit comments