Bug 556957 - Don't let startDocumentLoad display the target URL for content windows with openers. r=dao
authorGavin Sharp <gavin@gavinsharp.com>
Mon, 05 Apr 2010 19:08:01 -0400
changeset 42311 cadddabb1178a0f72abd464a8075d94429942d6a
parent 42310 ade46e1e12ecd6a15e62be47424bc287b5af7478
child 42312 95afe406d8d5db027c89d19b29922752263d07fe
push id13270
push userdgottwald@mozilla.com
push dateFri, 14 May 2010 07:53:34 +0000
treeherdermozilla-central@cadddabb1178 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs556957
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 556957 - Don't let startDocumentLoad display the target URL for content windows with openers. r=dao
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4254,18 +4254,23 @@ var XULBrowserWindow = {
     // clear out feed data
     gBrowser.selectedBrowser.feeds = null;
 
     // clear out search-engine data
     gBrowser.selectedBrowser.engines = null;
 
     var uri = aRequest.QueryInterface(Ci.nsIChannel).URI;
 
+    // Set the URI now if it isn't already set, so that the user can tell which
+    // site is loading. Only do this if the content window has no opener, though
+    // (i.e. the load wasn't triggered by a content-controlled link), to
+    // minimize spoofing risk.
     if (gURLBar &&
         gURLBar.value == "" &&
+        !content.opener &&
         getWebNavigation().currentURI.spec == "about:blank")
       URLBarSetURI(uri);
 
     try {
       Services.obs.notifyObservers(content, "StartDocumentLoad", uri.spec);
     } catch (e) {
     }
   },