Skip to content

Commit c31888d

Browse files
committed
Do note overwrite HAR object on the page
1 parent 36bfc9e commit c31888d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/har-driver-actor.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,15 @@ var HarDriverActor = ActorClass(
159159
Ci.nsIWebProgress.NOTIFY_STATE_WINDOW |
160160
Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT;
161161

162+
let win = this.parent.originalWindow;
163+
164+
// Do not overwrite HAR object. It might be already there if
165+
// autoConntect is on or there might be an existing object
166+
// with the same on the page.
167+
if (win.wrappedJSObject.HAR) {
168+
return;
169+
}
170+
162171
// The client just attached to this actor, let's expose
163172
// HAR API to the content.
164173
this.parent.webProgress.addProgressListener(this, notifyMask);

0 commit comments

Comments
 (0)