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
8fa8d23a
...
8fa8d23aa0146a63a0ade498dcfca7a47bbc7cc4
authored
2012-12-21 20:47:16 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixes #327 - event handler for 'page.confirm' always returns true
1 parent
111c00b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
modules/casper.js
tests/suites/casper/confirm.js
modules/casper.js
View file @
8fa8d23
...
...
@@ -1988,8 +1988,10 @@ function createPage(casper) {
}
};
page
.
onConfirm
=
function
onConfirm
(
message
)
{
var
listener_exists
=
typeof
casper
.
_filters
[
'page.confirm'
]
!==
'undefined'
;
return
listener_exists
?
casper
.
filter
(
'page.confirm'
,
message
)
:
true
;
if
(
'page.confirm'
in
casper
.
_filters
)
{
return
casper
.
filter
(
'page.confirm'
,
message
);
}
return
true
;
};
page
.
onConsoleMessage
=
function
onConsoleMessage
(
msg
)
{
// client utils casper console message
...
...
tests/suites/casper/confirm.js
View file @
8fa8d23
...
...
@@ -13,7 +13,7 @@ casper.start('tests/site/confirm.html', function() {
casper
.
then
(
function
()
{
//remove the page.confirm event filter so we can add a new one
delete
casper
.
_filters
[
'page.confirm'
];
casper
.
removeAllFilters
(
'page.confirm'
)
casper
.
setFilter
(
'page.confirm'
,
function
(
message
)
{
return
false
;
});
...
...
Please
register
or
sign in
to post a comment