* If a function returns a Promise, tt will wait for its resolution. * * {{> executeScript }}
(...args)
| 1959 | * {{> executeScript }} |
| 1960 | */ |
| 1961 | async executeScript(...args) { |
| 1962 | let context = await this._getContext() |
| 1963 | if (this.context && this.context.constructor.name === 'CdpFrame') { |
| 1964 | context = this.context // switching to iframe context |
| 1965 | } |
| 1966 | return context.evaluate.apply(context, args) |
| 1967 | } |
| 1968 | |
| 1969 | /** |
| 1970 | * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise. |
no test coverage detected