From bc388ec08fc792f97f5295dcaee84ca56ea29786 Mon Sep 17 00:00:00 2001 From: "myk%mozilla.org" Date: Wed, 23 Aug 2006 22:53:16 +0000 Subject: [PATCH] make the microsummary service stop loading about:blank in new hidden iframes to work around a crash when about:blank and another URI are both loading in a doc shell bug=344305 r=bzbarsky a=schrep on behalf of drivers for 1.8 branch git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@208253 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/nsMicrosummaryService.js.in | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js.in b/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js.in index e03ba838351..15d19292e93 100644 --- a/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js.in +++ b/mozilla/browser/components/microsummaries/src/nsMicrosummaryService.js.in @@ -2186,11 +2186,18 @@ MicrosummaryResource.prototype = { this._iframe.setAttribute("collapsed", true); this._iframe.setAttribute("type", "content"); - // Insert the iframe into the window, creating the doc shell, then turn off - // JavaScript and auth dialogs for security and turn off other things + // Insert the iframe into the window, creating the doc shell. + rootElement.appendChild(this._iframe); + + // When we insert the iframe into the window, it immediately starts loading + // about:blank, which we don't need and could even hurt us (for example + // by triggering bugs like bug 344305), so cancel that load. + var webNav = this._iframe.docShell.QueryInterface(Ci.nsIWebNavigation); + webNav.stop(Ci.nsIWebNavigation.STOP_NETWORK); + + // Turn off JavaScript and auth dialogs for security and other things // to reduce network load. // XXX We should also turn off CSS. - rootElement.appendChild(this._iframe); this._iframe.docShell.allowJavascript = false; this._iframe.docShell.allowAuth = false; this._iframe.docShell.allowPlugins = false; @@ -2201,12 +2208,6 @@ MicrosummaryResource.prototype = { var parseHandler = { _self: this, handleEvent: function MSR_parseHandler_handleEvent(event) { - // Appending a new iframe to a XUL window makes it immediately start - // loading "about:blank", and we'll probably get notified about that - // first, so make sure we check for that and drop it on the floor. - if (event.originalTarget.location == "about:blank") - return; - event.target.removeEventListener("DOMContentLoaded", this, false); try { this._self._handleParse(event) } finally { this._self = null }