Bug 900354 - Ignore sub-resource loads for Azure recordings. r=Bas
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 01 Aug 2013 14:55:28 -0700
changeset 153276 83d83bea9d55902b8be37b8189cb4f68b7aab1b8
parent 153275 6d6e336d037609d5787c69726ee2b5cd9bcbb709
child 153277 3cf583b9a2a7f525abec4a0917a402f5678ac3dd
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs900354
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 900354 - Ignore sub-resource loads for Azure recordings. r=Bas
layout/tools/recording/recording.js
--- a/layout/tools/recording/recording.js
+++ b/layout/tools/recording/recording.js
@@ -9,19 +9,19 @@ const CI = Components.interfaces;
 
 const NS_GFXINFO_CONTRACTID = "@mozilla.org/gfx/info;1";
 
 var gContainingWindow = null;
 
 var gBrowser;
 
 function OnDocumentLoad(evt) {
-dump(evt.target.location + "\n");
-    if (evt.target.location == "about:blank")
+    if (evt.target != gBrowser.contentDocument || evt.target.location == "about:blank")
         return;
+    gBrowser.removeEventListener("load", OnDocumentLoad, true);
     gContainingWindow.close();
 }
 
 this.OnRecordingLoad = function OnRecordingLoad(win) {
     if (win === undefined || win == null) {
         win = window;
     }
     if (gContainingWindow == null && win != null) {
@@ -34,14 +34,14 @@ this.OnRecordingLoad = function OnRecord
     var info = gfxInfo.getInfo();
     dump(info.AzureContentBackend + "\n");
     if (info.AzureContentBackend == "none") {
         alert("Page recordings may only be made with Azure content enabled.");
         gContainingWindow.close();
         return;
     }
 
-    gContainingWindow.document.addEventListener("load", OnDocumentLoad, true);
+    gBrowser.addEventListener("load", OnDocumentLoad, true);
 
     var args = window.arguments[0].wrappedJSObject;
 
     gBrowser.loadURI(args.uri);
 };