Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
set default timeout to infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Alexander Kienzl committed May 20, 2018
1 parent 326fdc7 commit 5ddf07c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/ChromeHeadless.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
class ChromeHeadless
{
protected $url;

protected $html;

protected $dom;

protected $user_agent;

protected $chrome_path = 'google-chrome';
protected $timeout = 10;

protected $timeout = null;

public function __construct(string $url = '')
{
Expand Down Expand Up @@ -100,7 +105,11 @@ protected function makeRequest()
$command = $this->createCommand();

$chrome = new Process($command);
$chrome->setTimeout($this->timeout);

if (! is_null($this->timeout)) {
$chrome->setTimeout($this->timeout);
}

$chrome->run();

if (! $chrome->isSuccessful()) {
Expand Down

0 comments on commit 5ddf07c

Please sign in to comment.