Skip to content

Commit

Permalink
Do note overwrite HAR object on the page
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Nov 13, 2015
1 parent 36bfc9e commit c31888d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/har-driver-actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ var HarDriverActor = ActorClass(
Ci.nsIWebProgress.NOTIFY_STATE_WINDOW |
Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT;

let win = this.parent.originalWindow;

// Do not overwrite HAR object. It might be already there if
// autoConntect is on or there might be an existing object
// with the same on the page.
if (win.wrappedJSObject.HAR) {
return;
}

// The client just attached to this actor, let's expose
// HAR API to the content.
this.parent.webProgress.addProgressListener(this, notifyMask);
Expand Down

0 comments on commit c31888d

Please sign in to comment.