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) {
page.onPageCreated = function onPageCreated(popupPage) {
casper.emit('popup.created', popupPage);
popupPage.onLoadFinished = function onLoadFinished() {
// SlimerJS needs this line of code because of issue
// https://github.com/laurentj/slimerjs/issues/48
// else checkStep turns into an infinite loop
// after clicking on an <a target="_blank">
casper.navigationRequested = false;
casper.popups.push(popupPage);
casper.emit('popup.loaded', popupPage);
};
......