navigationRequested is true only when navigating to a different URL
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -2203,7 +2203,7 @@ function createPage(casper) { | ... | @@ -2203,7 +2203,7 @@ function createPage(casper) { |
2203 | page.onNavigationRequested = function onNavigationRequested(url, type, lock, isMainFrame) { | 2203 | page.onNavigationRequested = function onNavigationRequested(url, type, lock, isMainFrame) { |
2204 | casper.log(f('Navigation requested: url=%s, type=%s, lock=%s, isMainFrame=%s', | 2204 | casper.log(f('Navigation requested: url=%s, type=%s, lock=%s, isMainFrame=%s', |
2205 | url, type, lock, isMainFrame), "debug"); | 2205 | url, type, lock, isMainFrame), "debug"); |
2206 | if (isMainFrame) { | 2206 | if (isMainFrame && casper.requestUrl !== url) { |
2207 | casper.navigationRequested = true; | 2207 | casper.navigationRequested = true; |
2208 | } | 2208 | } |
2209 | casper.emit('navigation.requested', url, type, lock, isMainFrame); | 2209 | casper.emit('navigation.requested', url, type, lock, isMainFrame); | ... | ... |
-
Please register or sign in to post a comment