Skip to content

Commit ac282c0

Browse files
committed
Offer a setting for ViewPort and a getter
the setOption just seemed to hard to figure out for this 2 string option
1 parent e1f9f7f commit ac282c0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Browser/Casper.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ public function setDebug($debug)
4747
$this->_debug = $debug;
4848
return $this;
4949
}
50+
51+
public function setViewPort($width, $height)
52+
{
53+
54+
$fragment =<<<FRAGMENT
55+
casper.then(function () {
56+
this.viewport($width, $height);
57+
});
58+
59+
FRAGMENT;
60+
61+
$this->_script .= $fragment;
62+
63+
return $this;
64+
}
65+
5066

5167
/**
5268
*

0 commit comments

Comments
 (0)