fix(agent-browser): enable preview page domain

This commit is contained in:
2026-08-27 02:35:36 +08:00
parent afb5c10fae
commit 23c49aa3d2
3 changed files with 98 additions and 0 deletions

View File

@@ -865,6 +865,11 @@ export class AgentBrowserModule {
value: PreviewDataInjectionValue,
sessionRef?: string,
): Promise<void> {
await record.view.webContents.debugger.sendCommand(
'Page.enable',
undefined,
sessionRef,
);
const response = await record.view.webContents.debugger.sendCommand(
'Page.addScriptToEvaluateOnNewDocument',
{ source: previewDataInjectionScript(binding.session.origin, value) },