Commit 8752de4a 8752de4a1ecd0596eac0624beec9657282d8e0be by Tyler Ritchie

fixes #327 page.confirm handlers can return true or false

1 parent 73265252
...@@ -1988,7 +1988,8 @@ function createPage(casper) { ...@@ -1988,7 +1988,8 @@ function createPage(casper) {
1988 } 1988 }
1989 }; 1989 };
1990 page.onConfirm = function onConfirm(message) { 1990 page.onConfirm = function onConfirm(message) {
1991 return casper.filter('page.confirm', message) || true; 1991 var listener_exists = typeof capser._filters['page.confirm'] !== 'undefined';
1992 return listener_exists ? casper.filter('page.confirm', message) : true;
1992 }; 1993 };
1993 page.onConsoleMessage = function onConsoleMessage(msg) { 1994 page.onConsoleMessage = function onConsoleMessage(msg) {
1994 // client utils casper console message 1995 // client utils casper console message
......