Bug 1374741 - Within toolkit/ make openUILinkIn() provide the correct triggeringPrincipal. r?Gijs draft
authorJonathan Kingston <jkt@mozilla.com>
Wed, 21 Feb 2018 23:08:42 +0000
changeset 779508 bc5dc3794db72456af7ccfad5d750f0afadc417b
parent 779507 893d6f5e01652cefdecd07dc0f5aa5cbb68e81c5
child 779509 3edbda51e8503059c4d44d2eb0d660aefceb7632
push id105784
push userbmo:jkt@mozilla.com
push dateTue, 10 Apr 2018 00:20:01 +0000
reviewersGijs
bugs1374741
milestone61.0a1
Bug 1374741 - Within toolkit/ make openUILinkIn() provide the correct triggeringPrincipal. r?Gijs MozReview-Commit-ID: AX2S3bEKl1w
toolkit/components/passwordmgr/content/passwordManager.js
toolkit/components/viewsource/content/viewSourceUtils.js
toolkit/content/widgets/autocomplete.xml
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -663,17 +663,17 @@ function EditCellInSelectedRow(columnNam
   let row = signonsTree.currentIndex;
   let columnElement = getColumnByName(columnName);
   signonsTree.startEditing(row, signonsTree.columns.getColumnFor(columnElement));
 }
 
 function LaunchSiteUrl() {
   let row = signonsTree.currentIndex;
   let url = signonsTreeView.getCellText(row, {id: "siteCol"});
-  window.openUILinkIn(url, "tab");
+  window.openWebLinkIn(url, "tab");
 }
 
 function UpdateContextMenu() {
   let singleSelection = (signonsTreeView.selection.count == 1);
   let menuItems = new Map();
   let menupopup = document.getElementById("signonsTreeContextMenu");
   for (let menuItem of menupopup.querySelectorAll("menuitem")) {
     menuItems.set(menuItem.id, menuItem);
@@ -684,17 +684,17 @@ function UpdateContextMenu() {
       menuItem.setAttribute("disabled", "true");
     }
     return;
   }
 
   let selectedRow = signonsTree.currentIndex;
 
   // Don't display "Launch Site URL" if we're not a browser.
-  if (window.openUILinkIn) {
+  if (window.openWebLinkIn) {
     menuItems.get("context-launchsiteurl").removeAttribute("disabled");
   } else {
     menuItems.get("context-launchsiteurl").setAttribute("disabled", "true");
     menuItems.get("context-launchsiteurl").setAttribute("hidden", "true");
   }
 
   // Disable "Copy Username" if the username is empty.
   if (signonsTreeView.getCellText(selectedRow, { id: "userCol" }) != "") {
--- a/toolkit/components/viewsource/content/viewSourceUtils.js
+++ b/toolkit/components/viewsource/content/viewSourceUtils.js
@@ -69,17 +69,17 @@ var gViewSourceUtils = {
       Services.ww.unregisterNotification(onOpen);
       let win = subj.QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
       win.addEventListener("load", () => {
         aArgs.viewSourceBrowser = win.gBrowser.selectedTab.linkedBrowser;
         utils.viewSourceInBrowser(aArgs);
       }, { once: true });
     });
-    window.top.openUILinkIn("about:blank", "current");
+    window.top.openWebLinkIn("about:blank", "current");
   },
 
   /**
    * Displays view source in the provided <browser>.  This allows for non-window
    * display methods, such as a tab from Firefox.
    *
    * @param aArgs
    *        An object with the following properties:
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -1243,17 +1243,17 @@
                            xbl:inherits="selected"/>
         </xul:description>
       </xul:hbox>
     </content>
 
     <handlers>
       <handler event="click" button="0"><![CDATA[
         let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
-        window.openUILinkIn(baseURL + "insecure-password", "tab", {
+        window.openTrustedLinkIn(baseURL + "insecure-password", "tab", {
           relatedToCurrent: true,
         });
       ]]></handler>
     </handlers>
 
     <implementation>
       <constructor><![CDATA[
         // Unlike other autocomplete items, the height of the insecure warning