Bug 680164 - Expose OS on SpecialPowers, r=jmaher

This commit is contained in:
Phil Ringnalda 2011-08-23 22:48:09 -07:00
parent be21706dbd
commit 72675bf33f

View File

@ -294,6 +294,20 @@ SpecialPowers.prototype = {
return this._xpcomabi;
},
_os: null,
get OS() {
if (this._os != null)
return this._os;
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo)
.QueryInterface(Components.interfaces.nsIXULRuntime);
this._os = xulRuntime.OS;
return this._os;
},
registerProcessCrashObservers: function() {
addMessageListener("SPProcessCrashService", this._messageListener);
sendSyncMessage("SPProcessCrashService", { op: "register-observer" });