From 7d21c850b011d53b73de8037f49009912440b7d9 Mon Sep 17 00:00:00 2001 From: papush Date: Thu, 29 Apr 2021 15:48:53 +0200 Subject: fix xpcom.js not exporting all its symbols there's likely a better way to do this, but xul/xpcom doc is hard to come by these days. Maybe that ChromeUtils thing i saw in a few places? Also I think Services.jsm should be used instead but whatever it works --- chrome/js/xpcom.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/chrome/js/xpcom.js b/chrome/js/xpcom.js index 2d18ff3..6a9313d 100644 --- a/chrome/js/xpcom.js +++ b/chrome/js/xpcom.js @@ -1,4 +1,3 @@ - Ci = Components.interfaces; Cc = Components.classes; Cr = Components.results; @@ -25,10 +24,25 @@ const StringBundleService = Service("@mozilla.org/intl/stringbundle;1", "nsIStri const ConsoleService = Service("@mozilla.org/consoleservice;1", "nsIConsoleService"); const PrefServie = Service("@mozilla.org/preferences-service;1", "nsIPrefService"); const DirectoryService = Service("@mozilla.org/file/directory_service;1", "nsIProperties"); - -var EXPORTED_SYMBOLS = []; -for (var name in this) { - if (name != 'Service' && name != 'QueryInterface' && name != 'name' && name != 'EXPORTED_SYMBOLS') { - EXPORTED_SYMBOLS.push(name); - } -} + +var EXPORTED_SYMBOLS = [ + 'ServerSocket', + 'ScriptableInputStream', + 'FileInputStream', + 'ConverterInputStream', + 'FileOutputStream', + 'ConverterOutputStream', + 'LocalFile', + 'FilePicker', + 'FilePickerMode', + 'PromptService', + 'IOService', + 'LocaleService', + 'StringBundleService', + 'ConsoleService', + 'PrefServie', + 'DirectoryService', + 'Ci', + 'Cc', + 'Cr' +]; -- cgit v1.2.3-70-g09d2