Commit 81b2094d 81b2094d61ecd1700508e17f6e71a122df854956 by Nicolas Perriault

fixed error when setting userAgent() casper being not started

1 parent 60019d5b
......@@ -1586,7 +1586,10 @@ Casper.prototype.toString = function toString() {
*/
Casper.prototype.userAgent = function userAgent(agent) {
"use strict";
this.options.pageSettings.userAgent = this.page.settings.userAgent = agent;
this.options.pageSettings.userAgent = agent;
if (this.started && this.page) {
this.page.settings.userAgent = agent;
}
return this;
};
......