From ef1fcb3e2c2d9b98b01626196b543a1c78ee8615 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Mon, 30 Apr 2012 16:17:31 -0400 Subject: [PATCH] Bug 750159 - Sometimes we get 'browser is null' errors in onLocationChange so remove the need for the browser r=mbrubeck --- mobile/android/chrome/content/browser.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 3bf426c43fbd..51d18251d2e0 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -2208,15 +2208,10 @@ Tab.prototype = { if (contentWin != contentWin.top) return; - let browser = BrowserApp.getBrowserForWindow(contentWin); - let uri = browser.currentURI.spec; - let documentURI = ""; - let contentType = ""; + let uri = aLocationURI.spec; + let documentURI = contentWin.document.documentURIObject.spec; + let contentType = contentWin.document.contentType; let sameDocument = (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) != 0; - if (browser.contentDocument) { - documentURI = browser.contentDocument.documentURIObject.spec; - contentType = browser.contentDocument.contentType; - } // Reset state of click-to-play plugin notifications. this.clickToPlayPluginDoorhangerShown = false;