Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/PageCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
} from '../node_modules/chrome-devtools-frontend/mcp/mcp.js';

import {FakeIssuesManager} from './DevtoolsUtils.js';
import {features} from './features.js';
import {logger} from './logger.js';
import type {
CDPSession,
Expand Down Expand Up @@ -228,9 +227,6 @@ export class ConsoleCollector extends PageCollector<

override addPage(page: Page): void {
super.addPage(page);
if (!features.issues) {
return;
}
if (!this.#subscribedPages.has(page)) {
const subscriber = new PageIssueSubscriber(page);
this.#subscribedPages.set(page, subscriber);
Expand Down
16 changes: 0 additions & 16 deletions src/features.ts

This file was deleted.

5 changes: 1 addition & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import './polyfill.js';
import type {Channel} from './browser.js';
import {ensureBrowserConnected, ensureBrowserLaunched} from './browser.js';
import {parseArguments} from './cli.js';
import {features} from './features.js';
import {loadIssueDescriptions} from './issue-descriptions.js';
import {logger, saveLogsToFile} from './logger.js';
import {McpContext} from './McpContext.js';
Expand Down Expand Up @@ -186,9 +185,7 @@ for (const tool of tools) {
registerTool(tool);
}

if (features.issues) {
await loadIssueDescriptions();
}
await loadIssueDescriptions();
const transport = new StdioServerTransport();
await server.connect(transport);
logger('Chrome DevTools MCP Server connected');
Expand Down
6 changes: 0 additions & 6 deletions src/tools/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import {features} from '../features.js';
import {zod} from '../third_party/index.js';
import type {ConsoleMessageType} from '../third_party/index.js';

Expand Down Expand Up @@ -38,10 +36,6 @@ const FILTERABLE_MESSAGE_TYPES: [
'issue',
];

if (features.issues) {
FILTERABLE_MESSAGE_TYPES.push('issue');
}

export const listConsoleMessages = defineTool({
name: 'list_console_messages',
description:
Expand Down
8 changes: 1 addition & 7 deletions tests/PageCollector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
*/

import assert from 'node:assert';
import {afterEach, beforeEach, describe, it} from 'node:test';
import {beforeEach, describe, it} from 'node:test';

import type {Frame, HTTPRequest, Target, Protocol} from 'puppeteer-core';
import sinon from 'sinon';

import {AggregatedIssue} from '../node_modules/chrome-devtools-frontend/mcp/mcp.js';
import {setIssuesEnabled} from '../src/features.js';
import type {ListenerMap} from '../src/PageCollector.js';
import {
ConsoleCollector,
Expand Down Expand Up @@ -301,11 +300,6 @@ describe('ConsoleCollector', () => {
},
},
};
setIssuesEnabled(true);
});

afterEach(() => {
setIssuesEnabled(false);
});

it('emits issues on page', async () => {
Expand Down
15 changes: 1 addition & 14 deletions tests/tools/console.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
*/

import assert from 'node:assert';
import {afterEach, before, beforeEach, describe, it} from 'node:test';
import {before, describe, it} from 'node:test';

import {AggregatedIssue} from '../../node_modules/chrome-devtools-frontend/mcp/mcp.js';
import {setIssuesEnabled} from '../../src/features.js';
import {loadIssueDescriptions} from '../../src/issue-descriptions.js';
import {McpResponse} from '../../src/McpResponse.js';
import {
Expand Down Expand Up @@ -59,12 +58,6 @@ describe('console', () => {
});

describe('issues', () => {
beforeEach(() => {
setIssuesEnabled(true);
});
afterEach(() => {
setIssuesEnabled(false);
});
it('lists issues', async () => {
await withMcpContext(async (response, context) => {
const page = await context.newPage();
Expand Down Expand Up @@ -155,12 +148,6 @@ describe('console', () => {

describe('issues type', () => {
const server = serverHooks();
beforeEach(() => {
setIssuesEnabled(true);
});
afterEach(() => {
setIssuesEnabled(false);
});

it('gets issue details with node id parsing', async t => {
await withMcpContext(async (response, context) => {
Expand Down