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 72555 ea80f5bf7e63c7b1af31569b71f13ef810216a0d
parent 72554 0d6b31b198f0c50ac25ed53adf0705bfc2d22dda
child 72582 e898a773a4fbe0d6e67159d5d2c96ac328e3956f
push id25
push usergsharp@mozilla.com
push dateSun, 10 Jul 2011 02:06:06 +0000
treeherderfx-team@ea80f5bf7e63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs664552
milestone8.0a1
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;