Skip to content

Commit

Permalink
Misc small fixes for AutoXHR
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma authored and Philip Tellis committed Dec 19, 2014
1 parent 1b391ad commit aa2eb79
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugins/auto_xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ MutationHandler.prototype.sendEvent = function(i) {

this.watch--;

this.clearTimeout();
ev.resource.resources = ev.resources;

BOOMR.responseEnd(ev.resource);
Expand All @@ -195,7 +196,7 @@ MutationHandler.prototype.setTimeout = function(timeout, index) {
MutationHandler.prototype.timedout = function(index) {
this.clearTimeout();

if(this.pending_events[index].type === "xhr") {
if(this.pending_events[index] && this.pending_events[index].type === "xhr") {
this.sendEvent(index);
}
else {
Expand Down Expand Up @@ -251,6 +252,13 @@ MutationHandler.prototype.wait_for_node = function(node, index) {

url=node.src || node.href;

if(node.nodeName === "IMG") {
if(node.naturalWidth) {
// img already loaded
return false;
}
}

// no URL or javascript: or about: URL, so no network activity
if(!url || url.match(/^(about:|javascript:)/i)) {
return false;
Expand Down

0 comments on commit aa2eb79

Please sign in to comment.