Skip to content

Commit b496dc4

Browse files
authored
chore(bidi): pass acceptInsecureCerts to createUserContext (#36052)
1 parent a5d1a18 commit b496dc4

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

packages/playwright-core/src/server/bidi/bidiBrowser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ export class BidiBrowser extends Browser {
124124
}
125125

126126
async doCreateNewContext(options: types.BrowserContextOptions): Promise<BrowserContext> {
127-
const { userContext } = await this._browserSession.send('browser.createUserContext', {});
127+
const { userContext } = await this._browserSession.send('browser.createUserContext', {
128+
acceptInsecureCerts: options.ignoreHTTPSErrors,
129+
});
128130
const context = new BidiBrowserContext(this, userContext, options);
129131
await context._initialize();
130132
this._contexts.set(userContext, context);

packages/playwright-core/src/server/bidi/third_party/bidiProtocolCore.ts

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,13 @@ export namespace Browser {
327327
export namespace Browser {
328328
export type CreateUserContext = {
329329
method: 'browser.createUserContext';
330-
params: EmptyParams;
330+
params: Browser.CreateUserContextParameters;
331+
};
332+
}
333+
export namespace Browser {
334+
export type CreateUserContextParameters = {
335+
acceptInsecureCerts?: boolean;
336+
proxy?: Session.ProxyConfiguration;
331337
};
332338
}
333339
export namespace Browser {
@@ -941,8 +947,14 @@ export namespace Emulation {
941947
};
942948
}
943949
export namespace Emulation {
944-
export type SetGeolocationOverrideParameters = {
945-
coordinates: Emulation.GeolocationCoordinates | null;
950+
export type SetGeolocationOverrideParameters = (
951+
| {
952+
coordinates: Emulation.GeolocationCoordinates | null;
953+
}
954+
| {
955+
error: Emulation.GeolocationPositionError;
956+
}
957+
) & {
946958
contexts?: [
947959
BrowsingContext.BrowsingContext,
948960
...BrowsingContext.BrowsingContext[],
@@ -990,6 +1002,11 @@ export namespace Emulation {
9901002
speed?: number | null;
9911003
};
9921004
}
1005+
export namespace Emulation {
1006+
export type GeolocationPositionError = {
1007+
type: 'positionUnavailable';
1008+
};
1009+
}
9931010
export type NetworkCommand =
9941011
| Network.AddIntercept
9951012
| Network.ContinueRequest
@@ -1699,16 +1716,16 @@ export namespace Script {
16991716
};
17001717
}
17011718
export namespace Script {
1702-
export type RegExpRemoteValue = {
1719+
export type RegExpRemoteValue = Script.RegExpLocalValue & {
17031720
handle?: Script.Handle;
17041721
internalId?: Script.InternalId;
1705-
} & Script.RegExpLocalValue;
1722+
};
17061723
}
17071724
export namespace Script {
1708-
export type DateRemoteValue = {
1725+
export type DateRemoteValue = Script.DateLocalValue & {
17091726
handle?: Script.Handle;
17101727
internalId?: Script.InternalId;
1711-
} & Script.DateLocalValue;
1728+
};
17121729
}
17131730
export namespace Script {
17141731
export type MapRemoteValue = {

0 commit comments

Comments
 (0)