Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/chromium/crBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class CRBrowser extends BrowserBase {

async startTracing(page?: Page, options: { path?: string; screenshots?: boolean; categories?: string[]; } = {}) {
assert(!this._tracingRecording, 'Cannot start recording trace while already recording trace.');
this._tracingClient = page ? (page._delegate as CRPage)._client : this._session;
this._tracingClient = page ? (page._delegate as CRPage)._mainFrameSession._client : this._session;

const defaultCategories = [
'-*', 'devtools.timeline', 'v8.execute', 'disabled-by-default-devtools.timeline',
Expand Down Expand Up @@ -364,7 +364,7 @@ export class CRBrowserContext extends BrowserContextBase {
geolocation = verifyGeolocation(geolocation);
this._options.geolocation = geolocation || undefined;
for (const page of this.pages())
await (page._delegate as CRPage)._client.send('Emulation.setGeolocationOverride', geolocation || {});
await (page._delegate as CRPage).updateGeolocation();
}

async setExtraHTTPHeaders(headers: network.Headers): Promise<void> {
Expand All @@ -376,13 +376,13 @@ export class CRBrowserContext extends BrowserContextBase {
async setOffline(offline: boolean): Promise<void> {
this._options.offline = offline;
for (const page of this.pages())
await (page._delegate as CRPage)._networkManager.setOffline(offline);
await (page._delegate as CRPage).updateOffline();
}

async setHTTPCredentials(httpCredentials: types.Credentials | null): Promise<void> {
this._options.httpCredentials = httpCredentials || undefined;
for (const page of this.pages())
await (page._delegate as CRPage)._networkManager.authenticate(httpCredentials);
await (page._delegate as CRPage).updateHttpCredentials();
}

async addInitScript(script: Function | string | { path?: string, content?: string }, arg?: any) {
Expand Down
Loading