mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(puppeteer-core): target interceptor is not async (#9430)
I found that the only call to `addTargetInterceptor` passes
`onAttachedToTarget` and is not async.
I also found a typo 🤓
This commit is contained in:
parent
65aedcdfc4
commit
e3e9cc622a
@ -353,7 +353,7 @@ export class ChromeTargetManager extends EventEmitter implements TargetManager {
|
||||
// present in #attachedTargetsBySessionId.
|
||||
assert(this.#attachedTargetsBySessionId.has(parentSession.id()));
|
||||
}
|
||||
await interceptor(
|
||||
interceptor(
|
||||
target,
|
||||
parentSession instanceof Connection
|
||||
? null
|
||||
|
@ -270,7 +270,7 @@ export class CDPPage extends Page {
|
||||
this.emit(PageEmittedEvents.WorkerDestroyed, worker);
|
||||
};
|
||||
|
||||
#onAttachedToTarget = async (createdTarget: Target) => {
|
||||
#onAttachedToTarget = (createdTarget: Target) => {
|
||||
this.#frameManager.onAttachedToTarget(createdTarget);
|
||||
if (createdTarget._getTargetInfo().type === 'worker') {
|
||||
const session = createdTarget._session();
|
||||
|
@ -33,7 +33,7 @@ export type TargetFactory = (
|
||||
export type TargetInterceptor = (
|
||||
createdTarget: Target,
|
||||
parentTarget: Target | null
|
||||
) => Promise<void>;
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* TargetManager encapsulates all interactions with CDP targets and is
|
||||
|
@ -229,7 +229,7 @@ describe('AriaQueryHandler', () => {
|
||||
await page.waitForSelector('aria/[role="button"]');
|
||||
});
|
||||
|
||||
it('should work for ElementHandler.waitForSelector', async () => {
|
||||
it('should work for ElementHandle.waitForSelector', async () => {
|
||||
const {page, server} = getTestState();
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.evaluate(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user