![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/php-webdriver/webdriver/lib/Chrome/ |
<?php namespace Facebook\WebDriver\Chrome; use Facebook\WebDriver\Remote\RemoteWebDriver; /** * Provide access to Chrome DevTools Protocol (CDP) commands via HTTP endpoint of Chromedriver. * * @see https://chromedevtools.github.io/devtools-protocol/ */ class ChromeDevToolsDriver { const SEND_COMMAND = [ 'method' => 'POST', 'url' => '/session/:sessionId/goog/cdp/execute', ]; /** * @var RemoteWebDriver */ private $driver; public function __construct(RemoteWebDriver $driver) { $this->driver = $driver; } /** * Executes a Chrome DevTools command * * @param string $command The DevTools command to execute * @param array $parameters Optional parameters to the command * @return array The result of the command */ public function execute($command, array $parameters = []) { $params = ['cmd' => $command, 'params' => (object) $parameters]; return $this->driver->executeCustomCommand( self::SEND_COMMAND['url'], self::SEND_COMMAND['method'], $params ); } }