fix: add missing await in adoptIfNeeded

This commit is contained in:
Yury Semikhatsky 2024-09-06 13:04:55 -07:00
parent 3fe1263643
commit 4c781070b0

View file

@ -160,7 +160,7 @@ export class FrameSelectors {
async function adoptIfNeeded<T extends Node>(handle: ElementHandle<T>, context: FrameExecutionContext): Promise<ElementHandle<T>> {
if (handle._context === context)
return handle;
const adopted = handle._page._delegate.adoptElementHandle(handle, context);
const adopted = await handle._page._delegate.adoptElementHandle(handle, context);
handle.dispose();
return adopted;
}