From 3e0cb9136bf1a428680db8a886eb8731b9a0b863 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Sun, 28 Aug 2011 23:54:21 +0200 Subject: XPCOM wrappers --- chrome/code/xpcom.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/code/xpcom.js') 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"); -- cgit v1.2.3-70-g09d2