Bug 664552: open location dialog should behave the same as the location bar, r=dao
authorGavin Sharp <gavin@gavinsharp.com>
Wed, 15 Jun 2011 16:39:57 -0400
changeset 72581 ea80f5bf7e63c7b1af31569b71f13ef810216a0d
parent 72580 0d6b31b198f0c50ac25ed53adf0705bfc2d22dda
child 72582 e898a773a4fbe0d6e67159d5d2c96ac328e3956f
push id20740
push usergsharp@mozilla.com
push dateSun, 10 Jul 2011 20:41:20 +0000
treeherdermozilla-central@e898a773a4fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs664552
milestone8.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 664552: open location dialog should behave the same as the location bar, r=dao
browser/base/content/openLocation.js
--- a/browser/base/content/openLocation.js
+++ b/browser/base/content/openLocation.js
@@ -91,27 +91,32 @@ function doEnabling()
 {
     dialog.open.disabled = !dialog.input.value;
 }
 
 function open()
 {
   var url;
   var postData = {};
+  var mayInheritPrincipal = {value: false};
   if (browser)
-    url = browser.getShortcutOrURI(dialog.input.value, postData);
+    url = browser.getShortcutOrURI(dialog.input.value, postData, mayInheritPrincipal);
   else
     url = dialog.input.value;
 
   try {
     // Whichever target we use for the load, we allow third-party services to
     // fixup the URI
     switch (dialog.openWhereList.value) {
       case "0":
-        browser.loadURI(url, null, postData.value, true);
+        var webNav = Components.interfaces.nsIWebNavigation;
+        var flags = webNav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
+        if (!mayInheritPrincipal.value)
+          flags |= webNav.LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
+        browser.gBrowser.loadURIWithFlags(url, flags, null, null, postData.value);
         break;
       case "1":
         window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no",
                                         url, postData.value, null, null, true);
         break;
       case "3":
         browser.delayedOpenTab(url, null, null, postData.value, true);
         break;