lib/Remote/RemoteWebDriver.php
public function executeAsyncScript($script, array $arguments = [])
    {
        $params = [
            'script' => $script,
            'args' => $this->prepareScriptArguments($arguments),
        ];

        return $this->execute(
            DriverCommand::EXECUTE_ASYNC_SCRIPT,
            $params
        );
    }
public function executeAsyncScript($script, array $arguments = [])
    {
        $params = [
            'script' => $script,
            'args' => $this->prepareScriptArguments($arguments),
        ];

        return $this->execute(
            DriverCommand::EXECUTE_ASYNC_SCRIPT,
            $params
        );
    }
public function executeAsyncScript ( $ script , array $ arguments = [ ] ) { $ params = [ 'script' => $ script , 'args' => $ this -> prepareScriptArguments ( $ arguments ) , ] ; return $ this -> execute ( DriverCommand :: EXECUTE_ASYNC_SCRIPT , $ params ) ; }
Inject a snippet of JavaScript into the page for asynchronous execution in the context of the currently selected
frame.

The driver will pass a callback as the last argument to the snippet, and block until the callback is invoked.

You may need to define script timeout using `setScriptTimeout()` method of `WebDriverTimeouts` first.

@param string $script The script to inject.
@param array $arguments The arguments of the script.
@return mixed The value passed by the script to the callback.
Inject a snippet of JavaScript into the page for asynchronous execution in the context of the currently selected frame .