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
cfd9bca2
...
cfd9bca2a142f07755ee234f8bacd137622fcbd3
authored
2012-06-27 15:41:20 -0700
by
reina.sweet
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
querySelector interface.
1 parent
df1e5cc3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
modules/casper.js
modules/casper.js
View file @
cfd9bca
...
...
@@ -936,6 +936,32 @@ Casper.prototype.open = function open(location, settings) {
};
/**
* Retrieves a DOM element matching the provided CSS3 selector.
*
* @param String selector A CSS3 selector
* @return HTMLElement The requested DOM element
*/
Casper
.
prototype
.
querySelector
=
function
querySelector
(
selector
)
{
"use strict"
;
return
this
.
evaluate
(
function
_evaluate
(
selector
)
{
return
window
.
querySelector
(
selector
);
},
{
selector
:
selector
});
};
/**
* Retrieves a NodeList of DOM elements matching the provided CSS3 selector.
*
* @param String selector A CSS3 selector
* @return HTMLElement[] The requested NodeList of DOM elements
*/
Casper
.
prototype
.
querySelectorAll
=
function
querySelectorAll
(
selector
)
{
"use strict"
;
return
this
.
evaluate
(
function
_evaluate
(
selector
)
{
return
window
.
querySelectorAll
(
selector
);
},
{
selector
:
selector
});
};
/**
* Reloads current page.
*
* @param Function then a next step function
...
...
Please
register
or
sign in
to post a comment