Skip to content

Commit f921ed8

Browse files
authored
Merge branch 'main' into fix-vieport-timeout
2 parents 7a4689f + 521c388 commit f921ed8

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

src/McpContext.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,6 @@ export class McpContext implements Context {
831831
}
832832

833833
async installExtension(extensionPath: string): Promise<string> {
834-
await this.validatePath(extensionPath);
835834
const id = await this.browser.installExtension(extensionPath);
836835
return id;
837836
}
@@ -862,37 +861,32 @@ export class McpContext implements Context {
862861
async getHeapSnapshotAggregates(
863862
filePath: string,
864863
): Promise<Record<string, AggregatedInfoWithId>> {
865-
await this.validatePath(filePath);
866864
return await this.#heapSnapshotManager.getAggregates(filePath);
867865
}
868866

869867
async getHeapSnapshotStats(
870868
filePath: string,
871869
): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.Statistics> {
872-
await this.validatePath(filePath);
873870
return await this.#heapSnapshotManager.getStats(filePath);
874871
}
875872

876873
async getHeapSnapshotStaticData(
877874
filePath: string,
878875
): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.StaticData | null> {
879-
await this.validatePath(filePath);
880876
return await this.#heapSnapshotManager.getStaticData(filePath);
881877
}
882878

883879
async getHeapSnapshotNodesById(
884880
filePath: string,
885881
id: number,
886882
): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.ItemsRange> {
887-
await this.validatePath(filePath);
888883
return await this.#heapSnapshotManager.getNodesById(filePath, id);
889884
}
890885

891886
async getHeapSnapshotRetainers(
892887
filePath: string,
893888
nodeId: number,
894889
): Promise<DevTools.HeapSnapshotModel.HeapSnapshotModel.ItemsRange> {
895-
await this.validatePath(filePath);
896890
return await this.#heapSnapshotManager.getRetainers(filePath, nodeId);
897891
}
898892
}

src/tools/extensions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const installExtension = defineTool({
2424
blockedByDialog: false,
2525
handler: async (request, response, context) => {
2626
const {path} = request.params;
27+
await context.validatePath(path);
2728
const id = await context.installExtension(path);
2829
response.appendResponseLine(`Extension installed. Id: ${id}`);
2930
},
@@ -79,6 +80,7 @@ export const reloadExtension = defineTool({
7980
if (!extension) {
8081
throw new Error(`Extension with ID ${id} not found.`);
8182
}
83+
await context.validatePath(extension.path);
8284
await context.installExtension(extension.path);
8385
response.appendResponseLine('Extension reloaded.');
8486
},

0 commit comments

Comments
 (0)