2 Jan 2003 Cardinal   » (Journeyer)

That's the beauty of XUL. Even a lousy web developer like me can tweak Mozilla, given a little digging around. Warning: this diary entry employs copious use of the <tt> tag.

dalke: Obviously the bug you quoted isn't resolved yet, so I don't know what the 'right' way to disable Ctrl-Q is (or rather, will be). However as a short term option, you can hack in a confirmation prompt to protect from inadvertant key combinations. This is, of course, a sub-optimal solution, since it'll get overwritten next time you upgrade Mozilla.

Short version:

Open up toolkit.jar and add this line (or something similar) to the top of goQuitApplication() in content/global/globalOverlay.js:

if (!confirm('Do you really want to exit?')) return false;

Long Version:

  1. Find toolkit.jar in your copy of Mozilla's chrome directory.
    On Windows, typically C:\Program Files\mozilla.org\Mozilla\chrome
    On Unix (Well, Debian at least), /usr/lib/mozilla/chrome
  2. Extract toolkit.jar into a temp dir. It's just zip file, so you can extract it with any zip tool.
  3. Open content/global/globalOverlay.js and add the line mentioned in the short version to the top of goQuitApplication().
  4. Re-create toolkit.jar with the changed file. Make sure the directory structure is preserved.
  5. Start up Moz and try Ctrl-Q. You should get a JS confirmation prompt, and selecting Cancel should keep Mozilla open.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!