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 cadddabb1178
parent 42310 ade46e1e12ec
child 42312 95afe406d8d5
push id13270
push userdgottwald@mozilla.com
push date2010-05-14 07:53 +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) {
     }
   },