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
77836645
...
77836645bbf1925fe0de34222e7fc35cc8d10fd2
authored
2011-11-12 17:49:06 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added type checking for the Casper's clientScripts option
1 parent
8a3996b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
casper.js
casper.js
View file @
7783664
...
...
@@ -60,6 +60,7 @@
this
.
currentHTTPStatus
=
200
;
this
.
defaultWaitTimeout
=
5000
;
this
.
delayedExecution
=
false
;
this
.
history
=
[];
this
.
loadInProgress
=
false
;
this
.
logLevels
=
[
"debug"
,
"info"
,
"warning"
,
"error"
];
this
.
logStyles
=
{
...
...
@@ -1577,12 +1578,16 @@
}
}
if
(
casper
.
options
.
clientScripts
)
{
if
(
betterTypeOf
(
casper
.
options
.
clientScripts
)
!==
"array"
)
{
casper
.
log
(
"The clientScripts option must be an array"
,
"error"
);
}
else
{
for
(
var
i
=
0
;
i
<
casper
.
options
.
clientScripts
.
length
;
i
++
)
{
var
script
=
casper
.
options
.
clientScripts
[
i
];
if
(
casper
.
page
.
injectJs
(
script
))
{
casper
.
log
(
'Automatically injected '
+
script
+
' client side'
,
"debug"
);
}
else
{
casper
.
log
(
'Failed injecting '
+
script
+
' client side'
,
"debug"
);
casper
.
log
(
'Failed injecting '
+
script
+
' client side'
,
"warning"
);
}
}
}
}
...
...
Please
register
or
sign in
to post a comment