lib/capybara/poltergeist/client/compiled/browser.js in poltergeist-1.13.0 vs lib/capybara/poltergeist/client/compiled/browser.js in poltergeist-1.14.0

- old
+ new

@@ -98,12 +98,15 @@ Browser.prototype.setModalMessage = function(msg) { this.processed_modal_messages.push(msg); }; Browser.prototype.add_extension = function(extension) { - this.currentPage.injectExtension(extension); - return this.current_command.sendResponse('success'); + if (this.currentPage.injectExtension(extension)) { + return this.current_command.sendResponse('success'); + } else { + return this.current_command.sendError(new Poltergeist.BrowserError("Unable to load extension: " + extension)); + } }; Browser.prototype.node = function(page_id, id) { if (this.currentPage.id === page_id) { return this.currentPage.get(id); @@ -586,12 +589,12 @@ height: height }); return this.current_command.sendResponse(true); }; - Browser.prototype.network_traffic = function() { - return this.current_command.sendResponse(this.currentPage.networkTraffic()); + Browser.prototype.network_traffic = function(type) { + return this.current_command.sendResponse(this.currentPage.networkTraffic(type)); }; Browser.prototype.clear_network_traffic = function() { this.currentPage.clearNetworkTraffic(); return this.current_command.sendResponse(true); @@ -622,12 +625,17 @@ allHeaders[name] = value; } return this.set_headers(allHeaders); }; - Browser.prototype.add_header = function(header, permanent) { - if (!permanent) { + Browser.prototype.add_header = function(header, arg1) { + var permanent, ref; + permanent = (ref = arg1.permanent) != null ? ref : true; + if (permanent !== true) { this.currentPage.addTempHeader(header); + if (permanent === "no_redirect") { + this.currentPage.addTempHeaderToRemoveOnRedirect(header); + } } return this.add_headers(header); }; Browser.prototype.response_headers = function() {