evaluateHandle<T extends JsHandle> method
The only difference between Worker.evaluate and Worker.evaluateHandle is that Worker.evaluateHandle returns in-page object (JSHandle).
If the function passed to the Worker.evaluateHandle returns a Promise
,
then Worker.evaluateHandle would wait for the promise to resolve and
return its value.
Shortcut for (await worker.executionContext).evaluateHandle
.
Parameters:
pageFunction
Function to be evaluated in the page contextargs
Arguments to pass topageFunction
returns: Future which resolves to the return value of pageFunction
as
in-page object (JSHandle)
Implementation
Future<T> evaluateHandle<T extends JsHandle>(
@Language('js') String pageFunction,
{List<dynamic>? args}) async {
return (await executionContext).evaluateHandle(pageFunction, args: args);
}