diff --git a/lib/har-driver-actor.js b/lib/har-driver-actor.js index afbc80e..e658f8a 100644 --- a/lib/har-driver-actor.js +++ b/lib/har-driver-actor.js @@ -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);