Hacking ChatZilla

I have a certain coworker (who will remain nameless) who razzes me endlessly when I’m not in the team IRC chat room. It’s not that I don’t want to be, it’s because the software is too stupid to reconnect me. I’m in and out of meetings all day and when I lose my connection, my IRC client of choice, ChatZilla, waits too long to reconnect me.

ChatZilla uses an exponential reconnect interval, so it starts at 15 seconds and then doubles after every failed attempt up to a max of 2 hours. Usually it hits that 2 hours overnight when I’m not connected to the VPN, then when I get into the office it can be up to 2 hours before it tries again.

I’ve tried other IRC clients, but I really prefer ChatZilla. It’s simple and can send all messages to Growl, so I don’t have to switch back and look at ChatZilla as messages come in. The only problem is this reconnect issue. Since ChatZilla is written in JavaScript, this was easy to fix.

  1. Find your ChatZilla Extension code. On my Mac, it was in /Users / jeff / Library / Application Support / Firefox / profiles / 71r60ff3.default / extensions / {59c81df5-4b7a-477b-912d-4e0fdf64e5f2} / chrome / chatzilla.jar . The username and profile directory name will differ on your system.
  2. Unzip the jar file (unzip chatzilla.jar)
  3. Open the file content/chatzilla/static.js from the extracted files.
  4. Change the line CIRCNetwork.prototype.MAX_RECONNECT_MS = 2 * 60 * 60 * 1000; to whatever interval you want. I set it to 15 * 60 * 1000 to make wait a maximum of 15 minutes.
  5. Rezip up the extracted files (zip -r chatzilla.jar content/ locale/ skin/).
  6. Restart Firefox.
  7. Enjoy the silence of non-whining coworkers.

It works:

[20:33]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 15 seconds. [Cancel]
[20:33]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[20:33]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 30 seconds. [Cancel]
[20:34]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[20:34]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 1 minute. [Cancel]
[20:35]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[20:35]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 2 minutes. [Cancel]
[20:37]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[20:37]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 4 minutes. [Cancel]
[20:41]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[20:41]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 8 minutes. [Cancel]
[20:49]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[20:49]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 15 minutes. [Cancel]
[21:04]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[21:04]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 15 minutes. [Cancel]
[21:19]	[INFO]	Connecting to irc://irc/ (irc://irc/)... [Cancel]
[21:19]	[ERROR]	The proxy server you configured is refusing the connection. Reconnecting in 15 minutes. [Cancel]

Hopefully the ChatZilla folks will make this an option in the future. For now, it’s good enough for me.

Leave a Reply

Your email address will not be published. Required fields are marked *