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() { ...@@ -1586,7 +1586,10 @@ Casper.prototype.toString = function toString() {
1586 */ 1586 */
1587 Casper.prototype.userAgent = function userAgent(agent) { 1587 Casper.prototype.userAgent = function userAgent(agent) {
1588 "use strict"; 1588 "use strict";
1589 this.options.pageSettings.userAgent = this.page.settings.userAgent = agent; 1589 this.options.pageSettings.userAgent = agent;
1590 if (this.started && this.page) {
1591 this.page.settings.userAgent = agent;
1592 }
1590 return this; 1593 return this;
1591 }; 1594 };
1592 1595
......