Is there a reason why frames don't have evaluateHandle()? I'm trying to use it like below:
````
const windowHandle = await frame.evaluateHandle((selector) => {
// Do various things
return aDOMElement;
}, selector);
const elementHandle = windowHandle.asElement();
await elementHandle.click();
````
Doc states that page.evaluateHandle()
is a shortcut for page.mainFrame().executionContext().evaluateHandle()
. So it seems you can use frame.executionContext().evaluateHandle()
.
Thanks @vsemozhetbyt, that's definitely a perfect workaround.
That being said, page and frame, up until now, have had similar methods. It feels off that this is missing.
Please feel free to send a PR with frame.evaluateHandle
method.
Most helpful comment
Thanks @vsemozhetbyt, that's definitely a perfect workaround.
That being said, page and frame, up until now, have had similar methods. It feels off that this is missing.