Skip to content

Chrome DevTools for coding agents

chore(build): remove obsolete protocol_client.js modifications (#739)

Simon Zünd79ab800b1e75
diff --git a/scripts/post-build.ts b/scripts/post-build.ts
index db702801..2193ed12 100644
--- a/scripts/post-build.ts
+++ b/scripts/post-build.ts
@@ -7,8 +7,6 @@
import * as fs from 'node:fs';
import * as path from 'node:path';
-import {sed} from './sed.ts';
-
const BUILD_DIR = path.join(process.cwd(), 'build');
/**
@@ -73,21 +71,6 @@ export const experiments = {
`;
writeFile(runtimeFile, runtimeContent);
- // Update protocol_client to remove:
- // 1. self.Protocol assignment
- // 2. Call to register backend commands.
- const protocolClientDir = path.join(
- BUILD_DIR,
- devtoolsFrontEndCorePath,
- 'protocol_client',
- );
- const clientFile = path.join(protocolClientDir, 'protocol_client.js');
- const globalAssignment = /self\.Protocol = self\.Protocol \|\| \{\};/;
- const registerCommands =
- /InspectorBackendCommands\.registerCommands\(InspectorBackend\.inspectorBackend\);/;
- sed(clientFile, globalAssignment, '');
- sed(clientFile, registerCommands, '');
-
copyDevToolsDescriptionFiles();
}
diff --git a/scripts/sed.ts b/scripts/sed.ts
deleted file mode 100644
index 817a269a..00000000
--- a/scripts/sed.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @license
- * Copyright 2025 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import * as fs from 'node:fs';
-
-/**
- * Replaces content in a file.
- * @param filePath The path to the file.
- * @param find The regex to find.
- * @param replace The string to replace with.
- */
-export function sed(
- filePath: string,
- find: RegExp | string,
- replace: string,
-): void {
- if (!fs.existsSync(filePath)) {
- console.warn(`File not found for sed operation: ${filePath}`);
- return;
- }
- const content = fs.readFileSync(filePath, 'utf-8');
- const newContent = content.replace(find, replace);
- fs.writeFileSync(filePath, newContent, 'utf-8');
-}