Rename lock to willNavigate
The phantomjs documentation[1] indicates that the lock variable is named 'willNavigate'. After a quick test, the values passed reflect that name, true indicating navigation will happen, false indicating it will not. [1]: https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#onnavigationrequested
Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -2262,13 +2262,13 @@ function createPage(casper) { | ... | @@ -2262,13 +2262,13 @@ function createPage(casper) { |
2262 | casper.emit('load.finished', status); | 2262 | casper.emit('load.finished', status); |
2263 | casper.loadInProgress = false; | 2263 | casper.loadInProgress = false; |
2264 | }; | 2264 | }; |
2265 | page.onNavigationRequested = function onNavigationRequested(url, type, lock, isMainFrame) { | 2265 | page.onNavigationRequested = function onNavigationRequested(url, type, willNavigate, isMainFrame) { |
2266 | casper.log(f('Navigation requested: url=%s, type=%s, lock=%s, isMainFrame=%s', | 2266 | casper.log(f('Navigation requested: url=%s, type=%s, willNavigate=%s, isMainFrame=%s', |
2267 | url, type, lock, isMainFrame), "debug"); | 2267 | url, type, willNavigate, isMainFrame), "debug"); |
2268 | if (isMainFrame && casper.requestUrl !== url) { | 2268 | if (isMainFrame && casper.requestUrl !== url) { |
2269 | casper.navigationRequested = true; | 2269 | casper.navigationRequested = true; |
2270 | } | 2270 | } |
2271 | casper.emit('navigation.requested', url, type, lock, isMainFrame); | 2271 | casper.emit('navigation.requested', url, type, willNavigate, isMainFrame); |
2272 | }; | 2272 | }; |
2273 | page.onPageCreated = function onPageCreated(popupPage) { | 2273 | page.onPageCreated = function onPageCreated(popupPage) { |
2274 | casper.emit('popup.created', popupPage); | 2274 | casper.emit('popup.created', popupPage); | ... | ... |
-
Please register or sign in to post a comment