feat(Frame): add Frame.evaluateHandle (#1885)

This patch adds Frame.evaluateHandle method. The method is a shortcut
for frame.executionContext().evaluateHandle.

Fixes #1051
This commit is contained in:
Yaniv Efraim
2018-01-25 07:16:01 +02:00
committed by Andrey Lushnikov
parent 5175d8e692
commit 189deb84c0
3 changed files with 47 additions and 0 deletions

View File

@@ -280,6 +280,16 @@ class Frame {
return this._contextPromise;
}
/**
* @param {function()|string} pageFunction
* @param {!Array<*>} args
* @return {!Promise<!Puppeteer.JSHandle>}
*/
async evaluateHandle(pageFunction, ...args) {
const context = await this._contextPromise;
return context.evaluateHandle(pageFunction, ...args);
}
/**
* @param {Function|string} pageFunction
* @param {!Array<*>} args