07/10/09 00:17:48 9IfLqP0I0
>>657
function BrowserRestart() {
const APP_START = Components.classes['@mozilla.org/toolkit/app-startup;1'].getService(Components.interfaces.nsIAppStartup);
APP_START.quit(APP_START.eRestart | APP_START.eAttemptQuit);
}
(function() {
var xml =
<overlay xmlns={ kXULNS }>
<commandset id="mainCommandSet">
<command id="Browser:Restart" oncommand="BrowserRestart();" />
</commandset>
<keyset id="mainKeyset">
<key id="key_BrowserRestart" key="Q" modifiers="accel" command="Browser:Restart" />
</keyset>
<menupopup id="menu_FilePopup">
<menuitem label="Restart" command="Browser:Restart" accesskey="R" key="key_BrowserRestart" insertbefore="menu_FileQuitItem" />
</menupopup>
</overlay>;
xml = "data:application/vnd.mozilla.xul+xml;charset=utf-8," + encodeURI(xml.toXMLString());
document.loadOverlay(xml, null);
})();