michael@0: function test() { michael@0: // simple test to confirm we have chrome privileges michael@0: let hasPrivileges = true; michael@0: michael@0: // this will throw an exception if we are not running with privileges michael@0: try { michael@0: var prefs = Components.classes["@mozilla.org/preferences-service;1"]. michael@0: getService(Components.interfaces.nsIPrefBranch); michael@0: } michael@0: catch (e) { michael@0: hasPrivileges = false; michael@0: } michael@0: michael@0: // if we get here, we must have chrome privileges michael@0: ok(hasPrivileges, "running with chrome privileges"); michael@0: }