mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: remove Page.prototype.target
from WebDriver BiDi (#11873)
This commit is contained in:
parent
15c986c2bc
commit
8a9fb1051a
@ -144,7 +144,6 @@ export class BidiPage extends Page {
|
||||
#keyboard: BidiKeyboard;
|
||||
#browsingContext: BrowsingContext;
|
||||
#browserContext: BidiBrowserContext;
|
||||
#target: BiDiPageTarget;
|
||||
|
||||
_client(): CDPSession {
|
||||
return this.mainFrame().context().cdpSession;
|
||||
@ -152,13 +151,11 @@ export class BidiPage extends Page {
|
||||
|
||||
constructor(
|
||||
browsingContext: BrowsingContext,
|
||||
browserContext: BidiBrowserContext,
|
||||
target: BiDiPageTarget
|
||||
browserContext: BidiBrowserContext
|
||||
) {
|
||||
super();
|
||||
this.#browsingContext = browsingContext;
|
||||
this.#browserContext = browserContext;
|
||||
this.#target = target;
|
||||
this.#connection = browsingContext.connection;
|
||||
|
||||
for (const [event, subscriber] of this.#browsingContextEvents) {
|
||||
@ -794,7 +791,7 @@ export class BidiPage extends Page {
|
||||
}
|
||||
|
||||
override target(): BiDiPageTarget {
|
||||
return this.#target;
|
||||
throw new UnsupportedOperation();
|
||||
}
|
||||
|
||||
override waitForFileChooser(): never {
|
||||
|
@ -138,7 +138,7 @@ export class BiDiPageTarget extends BiDiBrowsingContextTarget {
|
||||
) {
|
||||
super(browserContext, browsingContext);
|
||||
|
||||
this.#page = new BidiPage(browsingContext, browserContext, this);
|
||||
this.#page = new BidiPage(browsingContext, browserContext);
|
||||
}
|
||||
|
||||
override async page(): Promise<BidiPage> {
|
||||
|
@ -583,7 +583,7 @@ describe('Page', function () {
|
||||
// 3. After that, remove the iframe.
|
||||
frame.remove();
|
||||
});
|
||||
// 4. The target should always be the last one.
|
||||
// 4. The target will always be the last one.
|
||||
const popupTarget = page.browserContext().targets().at(-1)!;
|
||||
// 5. Connect to the popup and make sure it doesn't throw and is not the same page.
|
||||
expect(await popupTarget.page()).not.toBe(page);
|
||||
|
Loading…
Reference in New Issue
Block a user