Commit 50255710 502557108eb595bee21449104f76516cae1f6937 by Yevgeny Smirnov

navigationRequested is true only when navigating to a different URL

1 parent 3a4ed2c8
...@@ -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);
......