diff options
author | Einar Egilsson | 2011-08-28 23:54:21 +0200 |
---|---|---|
committer | Einar Egilsson | 2011-08-28 23:54:21 +0200 |
commit | 3e0cb9136bf1a428680db8a886eb8731b9a0b863 (patch) | |
tree | 0eeaaa2aa0ce60278a62e3243f2d029e3c44b634 /chrome | |
parent | 4fc435047afa02cf4be96a398c1a06c377901aba (diff) |
XPCOM wrappers
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/code/xpcom.js | 7 |
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"); |