(script, ...args)
| 123 | } |
| 124 | |
| 125 | async execute(script, ...args) { |
| 126 | await this.#initScript() |
| 127 | |
| 128 | const browsingContextId = await this.#driver.getWindowHandle() |
| 129 | |
| 130 | const argumentList = [] |
| 131 | |
| 132 | args.forEach((arg) => { |
| 133 | argumentList.push(LocalValue.getArgument(arg)) |
| 134 | }) |
| 135 | |
| 136 | const response = await this.#script.callFunctionInBrowsingContext(browsingContextId, script, true, argumentList) |
| 137 | |
| 138 | return response.result |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | module.exports = Script |