Open maidmaid opened 6 years ago
You can already pass arguments to the crime binary by setting them in ChromeManager::__construct()
.
It would be nice to addd a doc section about dev tools.
Also, if we can think to useful features leveraging this protocol, let’s add them as long as they don’t prevent using other browsers!
I found a solution without using the DevTools Protocol : enabling the performance log of the chrome driver.
ChromeDriver supports performance logging, from which you can get events of domains "Timeline", "Network", and "Page", as well as trace data for specified trace categories.
@maidmaid Could you provide an example, please?
Between these 2 lines of code, add :
$perfLoggingPrefs = new \stdClass();
$perfLoggingPrefs->enableNetwork = true;
$chromeOptions->setExperimentalOption('perfLoggingPrefs', $perfLoggingPrefs);
$loggingPrefs = new \stdClass();
$loggingPrefs->performance = 'ALL';
$capabilities->setCapability('loggingPrefs', $loggingPrefs);
And then, you can do :
$logs = $client->getWebDriver()->manage()->getLog('performance');
https://chromedevtools.github.io/devtools-protocol/
Basically, Chrome allows to be started with a
--remote-debugging-port
agument which gives access to the DevTools. That could significantly expand what we can do by manipulating for instance the Network panel in the DevTools. But maybe, integrating it in this project is off topic ?