feat: export Frame._client
through getter (#8041)
Co-authored-by: Randolf Jung <jrandolf@chromium.org>
This commit is contained in:
parent
c5e01efdef
commit
e9278fcfcf
@ -702,6 +702,11 @@ export class Frame {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @remarks
|
||||||
|
*
|
||||||
|
* @returns `true` if the frame is an OOP frame, or `false` otherwise.
|
||||||
|
*/
|
||||||
isOOPFrame(): boolean {
|
isOOPFrame(): boolean {
|
||||||
return this._client !== this._frameManager._client;
|
return this._client !== this._frameManager._client;
|
||||||
}
|
}
|
||||||
@ -785,6 +790,13 @@ export class Frame {
|
|||||||
return await this._frameManager.waitForFrameNavigation(this, options);
|
return await this._frameManager.waitForFrameNavigation(this, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
client(): CDPSession {
|
||||||
|
return this._client;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns a promise that resolves to the frame's default execution context.
|
* @returns a promise that resolves to the frame's default execution context.
|
||||||
*/
|
*/
|
||||||
|
@ -22,6 +22,7 @@ import {
|
|||||||
setupTestPageAndContextHooks,
|
setupTestPageAndContextHooks,
|
||||||
itFailsFirefox,
|
itFailsFirefox,
|
||||||
} from './mocha-utils'; // eslint-disable-line import/extensions
|
} from './mocha-utils'; // eslint-disable-line import/extensions
|
||||||
|
import { CDPSession } from '../lib/cjs/puppeteer/common/Connection.js';
|
||||||
|
|
||||||
describe('Frame specs', function () {
|
describe('Frame specs', function () {
|
||||||
setupTestBrowserHooks();
|
setupTestBrowserHooks();
|
||||||
@ -278,4 +279,11 @@ describe('Frame specs', function () {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Frame.client', function () {
|
||||||
|
it('should return the client instance', async () => {
|
||||||
|
const { page } = getTestState();
|
||||||
|
expect(page.mainFrame().client()).toBeInstanceOf(CDPSession);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -24,6 +24,7 @@ const {
|
|||||||
|
|
||||||
const EXCLUDE_PROPERTIES = new Set([
|
const EXCLUDE_PROPERTIES = new Set([
|
||||||
'Browser.create',
|
'Browser.create',
|
||||||
|
'Frame.client',
|
||||||
'Headers.fromPayload',
|
'Headers.fromPayload',
|
||||||
'Page.client',
|
'Page.client',
|
||||||
'Page.create',
|
'Page.create',
|
||||||
|
Loading…
Reference in New Issue
Block a user