feat: promisify executeJavaScript (#17312)
This commit is contained in:
parent
878538f2e8
commit
2e89348541
14 changed files with 164 additions and 100 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue