Created
May 14, 2014 18:35
-
-
Save yajd/105f4f8df3d5e7706282 to your computer and use it in GitHub Desktop.
_ff-addon-snippet-nsIProcessRunAsync - Example of running async and observer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exe = FileUtils.getFile('XREExeF', []); //this gives path to executable | |
var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess); | |
process.init(exe); | |
var obsToLaunchProfAfterCreate = { | |
observe: function (aSubject, aTopic, aData) { | |
console.info('incoming obsToLaunchProfAfterCreate: aSubject = ' + aSubject + ' | aTopic = ' + aTopic + ' | aData = ' + aData, { | |
aSubject: aSubject, | |
aTopic: aTopic, | |
aData: aData | |
}); | |
} | |
}; | |
var args = ['-P', 'default2', '-no-remote']; | |
var a = process.runAsync(args, args.length, obsToLaunchProfAfterCreate); | |
console.log('a', a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment