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
407a7bb9
...
407a7bb926d4797d4e6370a4dbeedcb2c50f9263
authored
2013-05-08 23:29:39 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated docs - refs #401, 402
1 parent
e468c0f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
CHANGELOG.md
docs/events-filters.rst
CHANGELOG.md
View file @
407a7bb
...
...
@@ -101,6 +101,18 @@ casper.test.begin("Planning 4 tests", 4, function(test) {
Last, all the casper test suites have been upgraded to use the new testing features, you may want to have a look at the changes.
#### Request abortion
When using PhantomJS >=1.9.0, you can now abort outgoing requests:
```
js
casper
.
on
(
'page.resource.requested'
,
function
(
requestData
,
request
)
{
if
(
requestData
.
url
.
indexOf
(
'http://adserver.com'
)
===
0
)
{
request
.
abort
();
}
});
```
### Bugfixes & enhancements
-
heavy lifting of casperjs bootstrap script
...
...
docs/events-filters.rst
View file @
407a7bb
...
...
@@ -273,6 +273,18 @@ Emitted when the HTTP response corresponding to current required url has been re
Emitted when a new HTTP request is performed to open the required url.
.. versionadded:: 1.1
**Arguments:** ``requestData, request``
You can also abort requests::
casper.on('page.resource.requested', function(requestData, request) {
if (requestData.url.indexOf('http://adserver.com') === 0) {
request.abort();
}
});
``popup.created``
~~~~~~~~~~~~~~~~~
...
...
Please
register
or
sign in
to post a comment