Bug 1498934: Fix handler app enumeration issue. r=Gijs

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

--HG--
extra : rebase_source : ed20681225d5357806bb33dd760dc8f01da58cdf
This commit is contained in:
Kris Maglione 2018-10-24 09:10:26 -07:00
Родитель a39577461e
Коммит 9e62048563
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -154,7 +154,7 @@ var dialog = {
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;