Bug 1637826 - Port bug 1196151 - Add second argument when making nsIExternalProtocolService.loadURI call. rs=bustage-fix
☠☠ backed out by a2eeb5818b3a ☠ ☠
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 14 May 2020 12:32:08 +1200
changeset 38248 2bd6adda19764077cad6db53586f51916aa2dd56
parent 38247 695fd95c327221a496cd3076a3ab43415263cada
child 38249 6c1be4cedbacab59d2e36706d5aa92df3c0c3722
push id2607
push userclokep@gmail.com
push dateMon, 01 Jun 2020 20:50:20 +0000
treeherdercomm-beta@9d45cd34927b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1637826, 1196151
Bug 1637826 - Port bug 1196151 - Add second argument when making nsIExternalProtocolService.loadURI call. rs=bustage-fix
calendar/base/content/dialogs/calendar-summary-dialog.js
calendar/base/src/calApplicationUtils.js
calendar/lightning/content/lightning-item-iframe.js
chat/content/conversation-browser.js
mail/base/content/contentAreaClick.js
mail/base/content/mailCore.js
mail/base/content/nsContextMenu.js
mail/base/content/phishingDetector.js
mail/base/content/profileDowngrade.js
mail/base/modules/AppUpdateUI.jsm
mail/components/MessengerContentHandler.jsm
mail/components/im/content/imAccountWizard.js
mail/components/newmailaccount/content/accountProvisioner.js
mailnews/extensions/newsblog/content/newsblogOverlay.js
--- a/calendar/base/content/dialogs/calendar-summary-dialog.js
+++ b/calendar/base/content/dialogs/calendar-summary-dialog.js
@@ -527,17 +527,17 @@ function openAttachment(aAttachmentId) {
   let args = window.arguments[0];
   let item = args.calendarEvent;
   let attachments = item
     .getAttachments()
     .filter(aAttachment => aAttachment.hashId == aAttachmentId);
   if (attachments.length && attachments[0].uri && attachments[0].uri.spec != "about:blank") {
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService)
-      .loadURI(attachments[0].uri);
+      .loadURI(attachments[0].uri, null);
   }
 }
 
 /**
  * Copy the value of the given link node to the clipboard.
  *
  * @param {string} linkNode The node containing the value to copy to the clipboard.
  */
--- a/calendar/base/src/calApplicationUtils.js
+++ b/calendar/base/src/calApplicationUtils.js
@@ -27,17 +27,17 @@ function launchBrowser(url, event) {
     Cu.reportError(
       "launchBrowser: Invalid URL provided: " + url + " Only http:// and https:// URLs are valid."
     );
     return;
   }
 
   Cc["@mozilla.org/uriloader/external-protocol-service;1"]
     .getService(Ci.nsIExternalProtocolService)
-    .loadURI(Services.io.newURI(url));
+    .loadURI(Services.io.newURI(url), null);
 
   // Make sure that any default click handlers don't do anything, we have taken
   // care of all processing
   if (event) {
     event.stopPropagation();
     event.preventDefault();
   }
 }
--- a/calendar/lightning/content/lightning-item-iframe.js
+++ b/calendar/lightning/content/lightning-item-iframe.js
@@ -2498,17 +2498,17 @@ function openAttachment() {
   // Only one file has to be selected and we don't handle base64 files at all
   let documentLink = document.getElementById("attachment-link");
   if (documentLink.selectedItem) {
     let attURI = documentLink.selectedItem.attachment.uri;
     let externalLoader = Cc["@mozilla.org/uriloader/external-protocol-service;1"].getService(
       Ci.nsIExternalProtocolService
     );
     // TODO There should be a nicer dialog
-    externalLoader.loadURI(attURI);
+    externalLoader.loadURI(attURI, null);
   }
 }
 
 /**
  * Copies the link location of the first selected attachment to the clipboard
  */
 function copyAttachment() {
   let documentLink = document.getElementById("attachment-link");
--- a/chat/content/conversation-browser.js
+++ b/chat/content/conversation-browser.js
@@ -147,17 +147,17 @@
         }
 
         event.preventDefault();
         event.stopPropagation();
 
         // loadURI can throw if the default browser is misconfigured.
         Cc["@mozilla.org/uriloader/external-protocol-service;1"]
           .getService(Ci.nsIExternalProtocolService)
-          .loadURI(uri);
+          .loadURI(uri, null);
       });
 
       this.addEventListener("keypress", event => {
         switch (event.keyCode) {
           case KeyEvent.DOM_VK_PAGE_UP: {
             if (event.shiftKey) {
               this.contentWindow.scrollByPages(-1);
             } else if (event.altKey) {
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -222,17 +222,17 @@ function openLinkExternally(url) {
           date: new Date(),
         },
       ],
     })
     .catch(Cu.reportError);
 
   Cc["@mozilla.org/uriloader/external-protocol-service;1"]
     .getService(Ci.nsIExternalProtocolService)
-    .loadURI(uri);
+    .loadURI(uri, null);
 }
 
 /**
  * Compatibility to Firefox, used for example by devtools to open links. Defer
  * this to the external browser for now, since in most cases this is meant to
  * open an actionable tab.
  */
 function openWebLinkIn(url, where, params) {
--- a/mail/base/content/mailCore.js
+++ b/mail/base/content/mailCore.js
@@ -716,17 +716,17 @@ function openSupportURL() {
 function openFormattedURL(aPrefName) {
   var urlToOpen = Services.urlFormatter.formatURLPref(aPrefName);
 
   var uri = Services.io.newURI(urlToOpen);
 
   var protocolSvc = Cc[
     "@mozilla.org/uriloader/external-protocol-service;1"
   ].getService(Ci.nsIExternalProtocolService);
-  protocolSvc.loadURI(uri);
+  protocolSvc.loadURI(uri, null);
 }
 
 /**
  * Opens the Troubleshooting page in a new tab.
  */
 function openAboutSupport() {
   let tabmail = document.getElementById("tabmail");
   tabmail.openTab("contentTab", {
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -1146,33 +1146,33 @@ nsContextMenu.prototype = {
           {
             date: new Date(),
           },
         ],
       })
       .catch(Cu.reportError);
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService)
-      .loadURI(Services.io.newURI(url));
+      .loadURI(Services.io.newURI(url), null);
   },
 
   openLinkInBrowser() {
     PlacesUtils.history
       .insert({
         url: this.linkURL,
         visits: [
           {
             date: new Date(),
           },
         ],
       })
       .catch(Cu.reportError);
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService)
-      .loadURI(this.linkURI);
+      .loadURI(this.linkURI, null);
   },
 
   mediaCommand(command) {
     var media = this.target;
 
     switch (command) {
       case "play":
         media.play();
--- a/mail/base/content/phishingDetector.js
+++ b/mail/base/content/phishingDetector.js
@@ -167,17 +167,17 @@ var gPhishingDetector = {
       "browser.safebrowsing.reportPhishURL"
     );
     reportUrl += "&url=" + encodeURIComponent(aPhishingURL);
 
     let uri = Services.io.newURI(reportUrl);
     let protocolSvc = Cc[
       "@mozilla.org/uriloader/external-protocol-service;1"
     ].getService(Ci.nsIExternalProtocolService);
-    protocolSvc.loadURI(uri);
+    protocolSvc.loadURI(uri, null);
   },
 
   /**
    * Private helper method to determine if the link node contains a user visible
    * url with a host name that differs from the actual href the user would get
    * taken to.
    * i.e. <a href="http://myevilsite.com">http://mozilla.org</a>
    *
--- a/mail/base/content/profileDowngrade.js
+++ b/mail/base/content/profileDowngrade.js
@@ -44,10 +44,10 @@ function moreInfo(event) {
   }
   event.preventDefault();
 
   let uri = Services.io.newURI(
     "https://support.mozilla.org/kb/unable-launch-older-version-profile"
   );
   Cc["@mozilla.org/uriloader/external-protocol-service;1"]
     .getService(Ci.nsIExternalProtocolService)
-    .loadURI(uri);
+    .loadURI(uri, null);
 }
--- a/mail/base/modules/AppUpdateUI.jsm
+++ b/mail/base/modules/AppUpdateUI.jsm
@@ -225,17 +225,17 @@ const AppUpdateUI_Internal = {
       ),
       accessKey: appUpdateBundle.GetStringFromName(
         "updateManualPrimaryButtonAccessKey"
       ),
       callback: () => {
         let url = Services.urlFormatter.formatURLPref("app.update.url.manual");
         Cc["@mozilla.org/uriloader/external-protocol-service;1"]
           .getService(Ci.nsIExternalProtocolService)
-          .loadURI(Services.io.newURI(url));
+          .loadURI(Services.io.newURI(url), null);
       },
     };
     let secondaryActions = [
       {
         label: appUpdateBundle.GetStringFromName(
           "updateManualSecondaryButtonLabel"
         ),
         accessKey: appUpdateBundle.GetStringFromName(
@@ -305,17 +305,17 @@ const AppUpdateUI_Internal = {
         [appName]
       ),
       accessKey: appUpdateBundle.GetStringFromName(
         "updateUnsupportedPrimaryButtonAccessKey"
       ),
       callback: () => {
         Cc["@mozilla.org/uriloader/external-protocol-service;1"]
           .getService(Ci.nsIExternalProtocolService)
-          .loadURI(Services.io.newURI(url));
+          .loadURI(Services.io.newURI(url), null);
       },
     };
     let secondaryActions = [
       {
         label: appUpdateBundle.GetStringFromName(
           "updateManualSecondaryButtonLabel"
         ),
         accessKey: appUpdateBundle.GetStringFromName(
--- a/mail/components/MessengerContentHandler.jsm
+++ b/mail/components/MessengerContentHandler.jsm
@@ -522,17 +522,17 @@ MailDefaultHandler.prototype = {
       }
       cmdLine.handleFlag("osint", false);
     }
   },
 
   openInExternal(uri) {
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService)
-      .loadURI(uri);
+      .loadURI(uri, null);
   },
 
   handleContent(aContentType, aWindowContext, aRequest) {
     try {
       if (
         !Cc["@mozilla.org/webnavigation-info;1"]
           .getService(Ci.nsIWebNavigationInfo)
           .isTypeSupported(aContentType, null)
--- a/mail/components/im/content/imAccountWizard.js
+++ b/mail/components/im/content/imAccountWizard.js
@@ -465,11 +465,11 @@ var accountWizard = {
       } catch (e) {}
     }
     getMore.hidden = !showGetMore;
   },
 
   openURL(aURL) {
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService)
-      .loadURI(Services.io.newURI(aURL));
+      .loadURI(Services.io.newURI(aURL), null);
   },
 };
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -250,17 +250,17 @@ var EmailAccountProvisioner = {
     // window itself, we open up the link in the default browser.
     let opener = Cc[
       "@mozilla.org/uriloader/external-protocol-service;1"
     ].getService(Ci.nsIExternalProtocolService);
     document.addEventListener("click", function(e) {
       if (e.target.tagName == "a" && e.target.classList.contains("external")) {
         e.preventDefault();
         let uri = e.target.getAttribute("href");
-        opener.loadURI(Services.io.newURI(uri, "UTF-8"));
+        opener.loadURI(Services.io.newURI(uri, "UTF-8"), null);
       }
     });
 
     // Throw the disclaimer into the window.  In the future, this should probably
     // be done in the actual XHTML page, instead of injected via JS.
     let commentary = document.querySelector(".commentary");
 
     let a = document.createElement("a");
--- a/mailnews/extensions/newsblog/content/newsblogOverlay.js
+++ b/mailnews/extensions/newsblog/content/newsblogOverlay.js
@@ -229,17 +229,17 @@ var FeedMessageHandler = {
               "invalid Content-Base header url - " +
               url
           );
           return;
         }
         if (aWhere.browser) {
           Cc["@mozilla.org/uriloader/external-protocol-service;1"]
             .getService(Ci.nsIExternalProtocolService)
-            .loadURI(uri);
+            .loadURI(uri, null);
         } else if (aWhere.messagepane) {
           let loadURIOptions = {
             triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
           };
           getBrowser().webNavigation.loadURI(url, loadURIOptions);
         } else if (aWhere.tab) {
           openContentTab(url, "tab", "^");
         } else if (aWhere.window) {