fix(agent-browser): preserve preview injection origin
This commit is contained in:
@@ -391,7 +391,7 @@ export class AgentBrowserModule {
|
||||
this.attachDebugger(record, false),
|
||||
OPEN_TIMEOUT_MS,
|
||||
);
|
||||
if (injectProjectData) await this.installPreviewData(record);
|
||||
if (injectProjectData) await this.installPreviewData(record, undefined, targetUrl);
|
||||
} catch (error) {
|
||||
await this.closeInternal(record);
|
||||
throw toFault(
|
||||
@@ -796,6 +796,7 @@ export class AgentBrowserModule {
|
||||
private async installPreviewData(
|
||||
record: BrowserRecord,
|
||||
sessionRef?: string,
|
||||
targetUrl?: string,
|
||||
): Promise<void> {
|
||||
if (record !== this.record || record.view.webContents.isDestroyed()) {
|
||||
throw new AgentBrowserFault(
|
||||
@@ -814,7 +815,7 @@ export class AgentBrowserModule {
|
||||
if (!sessionRef) {
|
||||
const openInput: PreviewDataSessionOpenInput = {
|
||||
projectPath: record.projectPath,
|
||||
origin: new URL(record.url).origin,
|
||||
origin: new URL(targetUrl ?? record.url).origin,
|
||||
browserGeneration: record.generation,
|
||||
};
|
||||
const session = await previewDataSession.open(openInput);
|
||||
|
||||
Reference in New Issue
Block a user