Bug 1007303 SeaMonkey should fix common scheme typos r=Ratty
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 20 May 2014 23:49:00 +0100
changeset 16221 69ff925f41a21da7dc77cd3fc44cf8cd83d19a9b
parent 16220 b533f0b61aef7cb41159205416d91603f9f60ad7
child 16222 68dbbff90bd5708909906d045c13fa384d389a12
push id10140
push userneil@parkwaycc.co.uk
push dateTue, 20 May 2014 22:53:05 +0000
treeherdercomm-central@1f0d20ca745f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty
bugs1007303
Bug 1007303 SeaMonkey should fix common scheme typos r=Ratty
editor/ui/composer/content/ComposerCommands.js
suite/browser/navigator.js
suite/browser/tabbrowser.xml
--- a/editor/ui/composer/content/ComposerCommands.js
+++ b/editor/ui/composer/content/ComposerCommands.js
@@ -2066,22 +2066,21 @@ var nsOpenRemoteCommand =
   doCommand: function(aCommand)
   {
     var params = { action: "2", url: "" };
     openDialog("chrome://communicator/content/openLocation.xul", "_blank", "chrome,modal,titlebar", params);
     var win = getTopWin();
     switch (params.action) {
       case "0": // current window
         win.focus();
-        win.loadURI(params.url, null,
-                    nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP);
+        win.loadURI(params.url, null, null, true);
         break;
       case "1": // new window
         openDialog(getBrowserURL(), "_blank", "all,dialog=no", params.url, null,
-                   null, nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP);
+                   null, null, true);
         break;
       case "2": // edit
         editPage(params.url);
         break;
       case "3": // new tab
         win.focus();
         var browser = win.getBrowser();
         browser.selectedTab = browser.addTab(params.url, {allowThirdPartyFixup: true});
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -1566,17 +1566,18 @@ function BrowserCloseWindow()
   window.close();
 }
 
 function loadURI(uri, referrer, postData, allowThirdPartyFixup, isUTF8)
 {
   try {
     var flags = nsIWebNavigation.LOAD_FLAGS_NONE;
     if (allowThirdPartyFixup) {
-      flags = nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
+      flags = nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
+              nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
     }
     if (isUTF8) {
       flags |= nsIWebNavigation.LOAD_FLAGS_URI_IS_UTF8;
     }
     if (!flags && typeof postData == "number") {
       // Deal with legacy code that passes load flags in the third argument.
       flags = postData;
       postData = null;
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -1422,17 +1422,18 @@
             if (!blank) {
               // pretend the user typed this so it'll be available till
               // the document successfully loads
               b.userTypedValue = aURI;
 
               let nsIWebNavigation = Components.interfaces.nsIWebNavigation;
               let flags = nsIWebNavigation.LOAD_FLAGS_NONE;
               if (aAllowThirdPartyFixup)
-                flags |= nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
+                flags = nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
+                        nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
               if (aFromExternal)
                 flags |= nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL;
               if (aIsUTF8)
                 flags |= nsIWebNavigation.LOAD_FLAGS_URI_IS_UTF8;
               try {
                 b.loadURIWithFlags(aURI, flags, aReferrerURI, aCharset, aPostData);
               }
               catch (ex) { }