You are here

public function BrowserNetworkTrait::networkTraffic in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/jcalderonzumba/gastonjs/src/Browser/BrowserNetworkTrait.php \Zumba\GastonJS\Browser\BrowserNetworkTrait::networkTraffic()

Get all the network traffic that the page have created

Return value

array

File

vendor/jcalderonzumba/gastonjs/src/Browser/BrowserNetworkTrait.php, line 16

Class

BrowserNetworkTrait
Trait BrowserNetworkTrait @package Zumba\GastonJS\Browser

Namespace

Zumba\GastonJS\Browser

Code

public function networkTraffic() {
  $networkTraffic = $this
    ->command('network_traffic');
  $requestTraffic = array();
  if (count($networkTraffic) === 0) {
    return null;
  }
  foreach ($networkTraffic as $traffic) {
    $requestTraffic[] = new Request($traffic["request"], $traffic["responseParts"]);
  }
  return $requestTraffic;
}