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
7069852b
...
7069852b969b56ba55ac27d69c281a7e4c927477
authored
2012-09-27 18:52:36 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
code reorganization
1 parent
a6d2a59a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
modules/casper.js
modules/casper.js
View file @
7069852
...
...
@@ -1193,6 +1193,22 @@ Casper.prototype.start = function start(location, then) {
};
/**
* Returns the current status of current instance
*
* @param Boolean asString Export status object as string
* @return Object
*/
Casper
.
prototype
.
status
=
function
status
(
asString
)
{
var
properties
=
[
'currentHTTPStatus'
,
'defaultWaitTimeout'
,
'loadInProgress'
,
'navigationRequested'
,
'options'
,
'pendingWait'
,
'requestUrl'
,
'started'
,
'step'
,
'url'
];
var
currentStatus
=
{};
properties
.
forEach
(
function
(
property
)
{
currentStatus
[
property
]
=
this
[
property
];
}.
bind
(
this
));
return
asString
===
true
?
utils
.
dump
(
currentStatus
)
:
currentStatus
;
};
/**
* Schedules the next step in the navigation process.
*
* @param function step A function to be called as a step
...
...
@@ -1313,23 +1329,6 @@ Casper.prototype.toString = function toString() {
};
/**
* Returns the current status of current instance
*
* @param Boolean asString Export status object as string
* @return Object
*/
Casper
.
prototype
.
status
=
function
status
(
asString
)
{
var
properties
=
[
'currentHTTPStatus'
,
'defaultWaitTimeout'
,
'loadInProgress'
,
'navigationRequested'
,
'options'
,
'pendingWait'
,
'requestUrl'
,
'started'
,
'step'
,
'url'
];
var
currentStatus
=
{};
properties
.
forEach
(
function
(
property
)
{
console
.
log
(
this
[
property
]);
currentStatus
[
property
]
=
this
[
property
];
}.
bind
(
this
));
return
asString
===
true
?
utils
.
dump
(
currentStatus
)
:
currentStatus
;
};
/**
* Sets the user-agent string currently used when requesting urls.
*
* @param String userAgent User agent string
...
...
Please
register
or
sign in
to post a comment