Skip to content

Commit

Permalink
Size sanity check at fitContent (fixes #729)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaZeR-RBI committed Feb 10, 2020
1 parent b3c538a commit 431347f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ public function fitContent()
$html = $this->driver->findElement(WebDriverBy::tagName('html'));

if (! empty($html)) {
if ($html->getSize()->getWidth() <= 0 || $html->getSize()->getHeight() <= 0) {
return $this;
}
$this->resize($html->getSize()->getWidth(), $html->getSize()->getHeight());
}

Expand Down

0 comments on commit 431347f

Please sign in to comment.