Commit 157408c5 157408c5ab2c8ab627d408eccbf0b4f0d90702fd by Laurent Jouanneau

Refs #482: fixes issue with popup opened by a _blank link

With SlimerJS, checkStep turns into an infinite loop when
clicking on an <a target="_blank"> links, because navigationRequested
is staying always at true. In fact, it should not be modify
to true. In this case, onNavigationRequested is called with
isMainFrame=true instead of false. This is an issue
of SlimerJS, that needs a patch on Gecko.
https://github.com/laurentj/slimerjs/issues/48

This is a "bypass" patch, and should be removed when
SlimerJS will be released with its own patched Gecko.
1 parent 8b98d4a5
...@@ -2437,6 +2437,11 @@ function createPage(casper) { ...@@ -2437,6 +2437,11 @@ function createPage(casper) {
2437 page.onPageCreated = function onPageCreated(popupPage) { 2437 page.onPageCreated = function onPageCreated(popupPage) {
2438 casper.emit('popup.created', popupPage); 2438 casper.emit('popup.created', popupPage);
2439 popupPage.onLoadFinished = function onLoadFinished() { 2439 popupPage.onLoadFinished = function onLoadFinished() {
2440 // SlimerJS needs this line of code because of issue
2441 // https://github.com/laurentj/slimerjs/issues/48
2442 // else checkStep turns into an infinite loop
2443 // after clicking on an <a target="_blank">
2444 casper.navigationRequested = false;
2440 casper.popups.push(popupPage); 2445 casper.popups.push(popupPage);
2441 casper.emit('popup.loaded', popupPage); 2446 casper.emit('popup.loaded', popupPage);
2442 }; 2447 };
......