feat: promisify executeJavaScript (#17312)

This commit is contained in:
Milan Burda 2019-03-14 20:08:54 +01:00 committed by Shelley Vohr
parent 878538f2e8
commit 2e89348541
14 changed files with 164 additions and 100 deletions

View file

@ -85,6 +85,15 @@ function getWebFrame (context: Window) {
return context ? new WebFrame(context) : null
}
const promisifiedMethods = new Set<string>([
'executeJavaScript',
'executeJavaScriptInIsolatedWorld'
])
for (const method of promisifiedMethods) {
(WebFrame as any).prototype[method] = deprecate.promisify((WebFrame as any).prototype[method])
}
const _webFrame = new WebFrame(window)
export default _webFrame