Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
52a67cb5
...
52a67cb5a21b03c05870755c276be80777c931e0
authored
2011-12-25 21:43:40 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed no error was raised if Casper.viewport() was called before casper having been started
1 parent
063ddf76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
lib/casper.js
lib/casper.js
View file @
52a67cb
...
...
@@ -881,6 +881,9 @@
* @return Casper
*/
viewport
:
function
(
width
,
height
)
{
if
(
!
this
.
started
)
{
throw
new
Error
(
"Casper must be started in order to set viewport at runtime"
);
}
if
(
!
isType
(
width
,
"number"
)
||
!
isType
(
height
,
"number"
)
||
width
<=
0
||
height
<=
0
)
{
throw
new
Error
(
"Invalid viewport width/height set: "
+
width
+
'x'
+
height
);
}
...
...
Please
register
or
sign in
to post a comment