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
a34fbd9e
...
a34fbd9e2c9b173dd56e9567d59fd48b08f4587c
authored
2012-07-11 17:50:40 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added casper.currentResponse to access latest received response object
1 parent
a12ef8f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
modules/casper.js
modules/casper.js
View file @
a34fbd9
...
...
@@ -111,6 +111,7 @@ var Casper = function Casper(options) {
this
.
checker
=
null
;
this
.
cli
=
phantom
.
casperArgs
;
this
.
colorizer
=
this
.
getColorizer
();
this
.
currentResponse
=
undefined
;
this
.
currentUrl
=
'about:blank'
;
this
.
currentHTTPStatus
=
0
;
this
.
defaultWaitTimeout
=
5000
;
...
...
@@ -1657,6 +1658,7 @@ function createPage(casper) {
casper
.
resources
.
push
(
resource
);
}
if
(
resource
.
url
===
casper
.
requestUrl
&&
resource
.
stage
===
"end"
)
{
casper
.
currentResponse
=
resource
;
casper
.
currentHTTPStatus
=
resource
.
status
;
casper
.
emit
(
'http.status.'
+
resource
.
status
,
resource
);
if
(
utils
.
isObject
(
casper
.
options
.
httpStatusHandlers
)
&&
...
...
Please
register
or
sign in
to post a comment