























@@ -164,6 +164,7 @@ describe("chrome MCP page parsing", () => {
164164"-y",
165165"chrome-devtools-mcp@latest",
166166"--autoConnect",
167+"--no-usage-statistics",
167168"--experimentalStructuredContent",
168169"--experimental-page-id-routing",
169170"--userDataDir",
@@ -182,6 +183,7 @@ describe("chrome MCP page parsing", () => {
182183"chrome-devtools-mcp@latest",
183184"--browserUrl",
184185"http://127.0.0.1:9222",
186+"--no-usage-statistics",
185187"--experimentalStructuredContent",
186188"--experimental-page-id-routing",
187189]);
@@ -197,6 +199,7 @@ describe("chrome MCP page parsing", () => {
197199"chrome-devtools-mcp@latest",
198200"--wsEndpoint",
199201"ws://127.0.0.1:9222/devtools/browser/abc",
202+"--no-usage-statistics",
200203"--experimentalStructuredContent",
201204"--experimental-page-id-routing",
202205]);
@@ -219,6 +222,36 @@ describe("chrome MCP page parsing", () => {
219222]);
220223});
221224225+it("lets explicit Chrome MCP usage-statistics args override the default opt-out", () => {
226+expect(
227+buildChromeMcpArgs({
228+mcpArgs: ["--usage-statistics"],
229+}),
230+).toEqual([
231+"-y",
232+"chrome-devtools-mcp@latest",
233+"--autoConnect",
234+"--experimentalStructuredContent",
235+"--experimental-page-id-routing",
236+"--usage-statistics",
237+]);
238+});
239+240+it("does not duplicate an explicit Chrome MCP usage-statistics opt-out", () => {
241+expect(
242+buildChromeMcpArgs({
243+mcpArgs: ["--no-usage-statistics"],
244+}),
245+).toEqual([
246+"-y",
247+"chrome-devtools-mcp@latest",
248+"--autoConnect",
249+"--experimentalStructuredContent",
250+"--experimental-page-id-routing",
251+"--no-usage-statistics",
252+]);
253+});
254+222255it("omits the npx package prefix for a custom Chrome MCP command", () => {
223256expect(
224257buildChromeMcpArgs({
@@ -228,6 +261,7 @@ describe("chrome MCP page parsing", () => {
228261).toEqual([
229262"--browserUrl",
230263"http://127.0.0.1:9222",
264+"--no-usage-statistics",
231265"--experimentalStructuredContent",
232266"--experimental-page-id-routing",
233267]);
@@ -338,7 +372,9 @@ describe("chrome MCP page parsing", () => {
338372339373expect(message).toContain("Chrome MCP existing-session attach failed");
340374expect(message).toContain("~/Library/Application Support/Google/Chrome/Profile 1");
341-expect(message).toContain("attach failed for ~/Library/Application Support/Google/Chrome/Profile 1");
375+expect(message).toContain(
376+"attach failed for ~/Library/Application Support/Google/Chrome/Profile 1",
377+);
342378expect(message).not.toContain(homeDir);
343379expect(message).not.toContain(userDataDir);
344380});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。