Commit ef6c1828 ef6c1828c7b64e1cf99b98e27600d0b63308cad3 by Nicolas Perriault

fixed edge case when current url couldn't be decoded

1 parent 541fba3d
......@@ -742,9 +742,14 @@ Casper.prototype.getPageContent = function getPageContent() {
*/
Casper.prototype.getCurrentUrl = function getCurrentUrl() {
"use strict";
return decodeURIComponent(this.evaluate(function _evaluate() {
var url = this.evaluate(function _evaluate() {
return document.location.href;
}));
});
try {
return decodeURIComponent(url);
} catch (e) {
return url;
}
};
/**
......