Disable image loading with PHP Selenium

2019-08-23 11:11发布

问题:

How do you disable image loading in ChromeOptions? (PHP library)

I tried the following but not sure if syntax is correct

$options = new ChromeOptions();

// disable images
$options->addArguments(array(
   "service_args=['--load-images=no']"
));

$caps = DesiredCapabilities::chrome();
$caps->setCapability(ChromeOptions::CAPABILITY, $options);

$driver = RemoteWebDriver::create($host, $caps);