aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinar Egilsson2011-08-28 23:54:21 +0200
committerEinar Egilsson2011-08-28 23:54:21 +0200
commit3e0cb9136bf1a428680db8a886eb8731b9a0b863 (patch)
tree0eeaaa2aa0ce60278a62e3243f2d029e3c44b634
parent4fc435047afa02cf4be96a398c1a06c377901aba (diff)
XPCOM wrappers
-rw-r--r--chrome/code/xpcom.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/code/xpcom.js b/chrome/code/xpcom.js
index ec2232f..a983433 100644
--- a/chrome/code/xpcom.js
+++ b/chrome/code/xpcom.js
@@ -11,3 +11,10 @@ const ScriptableInputStream = Components.Constructor("@mozilla.org/scriptableinp
const FileInputStream = Components.Constructor("@mozilla.org/network/file-input-stream;1", "nsIFileInputStream", "init");
const ConverterInputStream = Components.Constructor("@mozilla.org/intl/converter-input-stream;1", "nsIConverterInputStream", "init");
const LocalFile = Components.Constructor("@mozilla.org/file/local;1", "nsILocalFile", "initWithPath");
+
+function Service(className, interfaceName)
+ return Cc[className].getService(Ci[interfaceName]);
+}
+
+const PromptService = Service("@mozilla.org/embedcomp/prompt-service;1","nsIPromptService");
+const IOService = Service("@mozilla.org/network/io-service;1","nsIIOService");