Bug 1498934 - Fix handler app enumeration issue. r=Gijs, a=RyanVM
authorKris Maglione <maglione.k@gmail.com>
Wed, 24 Oct 2018 09:10:26 -0700
changeset 500934 c96f6ed751bf51a86d910aad441c3b1538f674a7
parent 500933 761e9b73da90ed206ee661844f4a5cc6bb37fac8
child 500935 f9da620994ae1a1cf533882625c1777af07f56c3
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, RyanVM
bugs1498934
milestone64.0
Bug 1498934 - Fix handler app enumeration issue. r=Gijs, a=RyanVM Since gioApps here is a plain nsIArray, it doesn't have any intrinsic type information, and we only get the correct interfaces if they've already been queried. Adding an interface parameter to the enumerate() call fixes the issue. This code is apparently untested, or incompletely tested. Differential Revision: https://phabricator.services.mozilla.com/D9672
toolkit/mozapps/handling/content/dialog.js
--- a/toolkit/mozapps/handling/content/dialog.js
+++ b/toolkit/mozapps/handling/content/dialog.js
@@ -149,17 +149,17 @@ var dialog = {
           this.selectedItem = elm;
     }
 
     // Add gio handlers
     if (Cc["@mozilla.org/gio-service;1"]) {
       let gIOSvc = Cc["@mozilla.org/gio-service;1"]
                      .getService(Ci.nsIGIOService);
       var gioApps = gIOSvc.getAppsForURIScheme(this._URI.scheme);
-      for (let handler of gioApps.enumerate()) {
+      for (let handler of gioApps.enumerate(Ci.nsIHandlerApp)) {
         // OS handler share the same name, it's most likely the same app, skipping...
         if (handler.name == this._handlerInfo.defaultDescription) {
           continue;
         }
         // Check if the handler is already in possibleHandlers
         let appAlreadyInHandlers = false;
         for (let i = possibleHandlers.length - 1; i >= 0; --i) {
           let app = possibleHandlers.queryElementAt(i, Ci.nsIHandlerApp);