Backward compatible
Disabling alerts stops JavaScript execution in #Firefox

Today I learned about interesting issue with newer versions of Firefox (I use FF7). It has a nice web developer-friendly feature to disable alerts. This is really useful when you place alert() by mistake in some loop and you can’t get out because as soon as you click OK, you get another one.

New Firefox has a checkbox to disable future alerts. And this is great. So, what’s the problem? Once you disable alerts, and javascript code is executed that would display it, it does not keep running, but rather throws an exception. This does not look like correct behavior to me.

Imagine a web application that alerts user about something and then keeps running to finish the job. If user disabled alerts because he was in a hurry and clicked fast on different message boxes, the script would not keep going but stop. And there is no way to revert that short of reloading the page (yikes!).

I found a workaround, I created a function called tryalert that wraps the alert in try..catch block. It looks like this:

function tryalert(message) 
{
    try { alert(message); } catch(e) {}
}

This is a fine workaround. Now instead of alert() I call tryalert() and although the alert is not displayed anymore, the code keeps going as if user has been alerted.

The problem is introducing tryalert to ALL applications I’ve written so far. It’s impossible. I hope Firefox team changes this.

Things that hamper my productivity
Almost each day I’m facing obstacles that cut my workflow, make me go
around or just make me go mad. Here are some that repeat every once in
a while or just happened recently:

1. Firefox crashing
2. Google Apps multi-login failure
3. Linux terminal
4. Liquidweb routing
5. Xorg server killing keyboard
6. stuck SSH sessions

Ok, let’s go into details:

1. Firefox crashing

One of the best features Firefox has is crash-recovery, and that with
good reason. However, it still is not perfect. It happens often that I
have 10+ tabs open, one of those crashes FF and when I restart all my
GMail sessions are lost (see point 2. for more pain), I have to log in
again. Same with some other websites. Sending report to mozilla takes
forever, and even though there are sites I reported like 50+ times
while using FF 2, 3, 3.5 and 3.6, it still crashes FF 4. I wish Chrome
was easier to install on Slackware and if it had all the extensions I
needed (TamperData, Firebug, RequestPolicy, Screengrab are a must)

2. Google Apps multi-login failure

Having to log into accounts in exact order is painfull. What’s even
worse, once browser saves the cookie it is impossible to login into
any of domain-based accounts directly. You have to log into regular
GMail account first. Maybe I should take a job offer to go to work for
Google and help them fix this ;)

3. Linux terminal

I spend about 20% of my working time in terminal, mostly using ssh to
access remote computers or using make to build/install programs and
packages. KDE’s Konsole is the best tool I used. However, these is one
problem with resizing. I still haven’t been able to determine the
exact way to reproduce it, but switching from 80x25 to fullscreen at
some point starts a strange behavior. Parts of typed text get lost,
overwritten. This happens only when command cannot fit in 80 
characters. Maybe it happens when you get one command that is too long
for the fullscreen terminal, and after that something gets messed up.
I never managed to catch it, but it does annoy me. The only was to get
proper line wrapping back is to normalize the window size so that the
terminal is 80x25 again and then you should forget about fullscreen
until you log out and log in again.

4. Liquidweb routing

For more than a week, there has been some routing problem in
Liquidweb, and it does not look like it’s going to be fixed any time
soon. Searching on Google yielded some results, i.e. other people see
this problem, but it seems to be only sporadic in US, and I guess LW
does not care about the rest of the world. Some of my websites are
hosted at DTH and I’m accessing from Europe. Using some different ISP
in Europe makes it work, but traceroute shows completely different
path that does not go through LW at all. To cut the story short, I
don’t have access to our main bug/issue tracker, 3 company websites,
and one web service I’m using. I have to build SSH tunnels to my other
servers and reconfigure my local system to deal with this. It’s not
unsolvable, but it’s a major PITA.

5. Xorg server killing keyboard

When I’m working all day at full speed, I get this at least once. It
only happens on my 2 desktop computers, the laptop running same
version of Linux kernel and Xorg works just fine. At some time the
keyboard simply stops responding. I can you the mouse though. I tried
replacing the keyboard, mouse and motherboard, problem is still here.
This leaves the only conclusion: it must be software. It’s either
Linux or Xorg. My guess is Xorg, because I can use mouse to log out of
KDE, and then keyboard magically starts working again and I can type
password at KDM login to log back in.

6. stuck SSH sessions

I guess there is some configuration on my client’s network routers to
simply “lose” stale network connections. I log in via SSH and some
20-30 minutes later the session is stuck. The connection is not
dropped, it just stays there, waiting.

Do you have some stuff that really get’s on your nerve on a daily
basis? Please share…

Firefox 3.5 faster?

Ever since I installed Firefox 3.5 I felt it was a little bit more
sluggish, bloated and slow compared to previous versions, but I liked
some of the new features.

But today, I just had enough. To state it plainly: Firefox 3.5 IS SLOW!

I installed Firefox 2.0 and it flies. It must be like 3 times faster
and 2 time less resource intensive. One of the things I also disliked
about 3.5 is that sometimes when I’m not doing anything, it would
start to do “something” that requires hard disk, so my disk would get
really busy.

I hope Firefox developers get their stuff together and makes the
browser better, not just more feature-full. Some of the features in
3.5 are really strange. For example, the + button to open new tab.
There has been a toolbar button to open a new tab since forever (I
always add it after installing). Instead of simply making that button
shown by default, they apparently decided to do copycat job of some
other browser’s feature. That was very cheap move, esp. since I find
the toolbar much more useful because it is always at the same place on
the screen and I don’t have to search for it.

Competition is moving forward (Chrome, Opera, …) and it seems
Firefox is losing the direction. It there wasn’t for great plugins, it
would lose market share quickly.