Okay so I think I found a solution that does not require any altering to the applications code. It ain't pretty, but it seems to work:
/**
* If you have a problem...
* if no one else can help...
* and if you can find them...
* maybe you can hire...
* fakeXHR.
*
* Overwrites XMLHttpRequest and auto resoles with status and response
* @param {Number} status The statuscode to resolve with
* @param {String} response, The response to resolve with
*/
function fakeXHR(status, response) {
browser.executeScript(function (args) {
var status = args[0];
var response = args[1];
function FakeXHR() {
this.open = function() {}
this.send = function() {}
this.setRequestHeader = function() {}
setTimeout(function() {
this.response = response;
this.status = status;
this.onload();
}.bind(this), 0);
}
XMLHttpRequest = FakeXHR;
}, [status, response])
}