rem: var close = true; if (client.prefs["warnOnClose"]) { const buttons = ["!yes", "!no"]; var checkState = { value: true }; var rv = confirmEx(MSG_CONFIRM_QUIT, buttons, 0, MSG_WARN_ON_EXIT, checkState); close = (rv == 0); client.prefs["warnOnClose"] = checkState.value; }  if (close) { client.userClose = true; display(MSG_CLOSING); client.quit(); } 
add: client.wantToQuit(); 
context: function onClose(){    if ("userClose" in client && client.userClose)        return true;    if (!("getConnectionCount" in client) ||        client.getConnectionCount() == 0)    {        /* if we're not connected to anything, just close the window */        return true;    }    /* otherwise, try to close out gracefully */    var close = true;    if (client.prefs["warnOnClose"])    {        const buttons = ["!yes", "!no"];        var checkState = { value: true };        var rv = confirmEx(MSG_CONFIRM_QUIT, buttons, 0, MSG_WARN_ON_EXIT,                           checkState);        close = (rv == 0);        client.prefs["warnOnClose"] = checkState.value;    }    if (close)    {        client.userClose = true;        display(MSG_CLOSING);        client.quit();    }    return false;}
meta: 1567	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1567/949f0c06c485077db1f3118c578d0a38938f6bb4/handlers.js/buggy/xul/content/handlers.js