You are here

trait BrowserNetworkTrait 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

Trait BrowserNetworkTrait @package Zumba\GastonJS\Browser

Hierarchy

File

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

Namespace

Zumba\GastonJS\Browser
View source
trait BrowserNetworkTrait {

  /**
   * Get all the network traffic that the page have created
   * @return array
   */
  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;
  }

  /**
   * Clear the network traffic data stored on the phantomjs code
   * @return mixed
   */
  public function clearNetworkTraffic() {
    return $this
      ->command('clear_network_traffic');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrowserNetworkTrait::clearNetworkTraffic public function Clear the network traffic data stored on the phantomjs code
BrowserNetworkTrait::networkTraffic public function Get all the network traffic that the page have created