refactor: type-cast as internal CdpPage interface (#1064)

This commit is contained in:
Alex Rudenko authored and GitHub committed 2026-02-27 13:16:15 +00:00
1 parent f763da24a1
commit 2d5e4fa357
1 file changed
+2 -3
+2 -3
View File
@@ -5,7 +5,7 @@
*/
import {logger} from '../logger.js';
import type {Dialog} from '../third_party/index.js';
import type {CdpPage, Dialog} from '../third_party/index.js';
import {zod} from '../third_party/index.js';
import {ToolCategory} from './categories.js';
@@ -385,8 +385,7 @@ export const getTabId = definePageTool({
},
handler: async (request, response, context) => {
const page = context.getPageById(request.params.pageId);
// @ts-expect-error _tabId is internal.
const tabId = page.pptrPage._tabId;
const tabId = (page.pptrPage as unknown as CdpPage)._tabId;
response.setTabId(tabId);
},
});