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
b8435d4b
...
b8435d4bdac81b26e9af680fed3e9fa4d70e2eb0
authored
2012-11-21 11:02:08 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
damn you scoping issues
1 parent
961e052f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
modules/casper.js
modules/casper.js
View file @
b8435d4
...
...
@@ -1027,15 +1027,18 @@ Casper.prototype.injectClientUtils = function injectClientUtils() {
* @return Casper
*/
Casper
.
prototype
.
includeRemoteScripts
=
function
includeRemoteScripts
()
{
if
(
this
.
options
.
remoteScripts
.
length
===
0
)
{
"use strict"
;
var
numScripts
=
this
.
options
.
remoteScripts
.
length
,
loaded
=
0
;
if
(
numScripts
===
0
)
{
return
this
;
}
this
.
waitStart
();
this
.
options
.
remoteScripts
.
forEach
(
function
(
scriptUrl
,
i
)
{
this
.
options
.
remoteScripts
.
forEach
(
function
(
scriptUrl
)
{
this
.
log
(
f
(
"Loading remote script: %s"
,
scriptUrl
),
"debug"
);
this
.
page
.
includeJs
(
scriptUrl
,
function
()
{
loaded
++
;
this
.
log
(
f
(
"Remote script %s loaded"
,
scriptUrl
),
"debug"
);
if
(
i
===
this
.
options
.
remoteScripts
.
length
-
1
)
{
if
(
loaded
===
numScripts
)
{
this
.
log
(
"All remote scripts loaded."
,
"debug"
);
this
.
waitDone
();
}
...
...
@@ -1855,6 +1858,7 @@ function createPage(casper) {
casper
.
emit
(
'load.started'
);
};
page
.
onLoadFinished
=
function
onLoadFinished
(
status
)
{
/*jshint maxstatements:20*/
if
(
status
!==
"success"
)
{
casper
.
emit
(
'load.failed'
,
{
status
:
status
,
...
...
Please
register
or
sign in
to post a comment