Firefox, Java 5.0 (JRE) and an extremly stupid bug · 15. November 2004, 13:59

So, today I updated Firefox to 1.0 . I had installed Firefox on my spare PC, and it worked without any problems. Since I didn’t have a JRE installed but I needed access to an applet I installed the current Java Runtime Environment 5.0 as well. Everything worked nice, and since JRE 5.0 seemed to be a bit faster and the UI-Elements of the applets a bit more responsive, I decided to update the JRE on my main Computer as well.

Well it turned out, that on my main PC something didn’t quiet work the way it should. I got the following error message whenever I tried to access a page with a Java-Applet:

error message box error message box (2)

Hmmm – that didn’t make any sense whatsoever. Ok, so I uninstalled and re-installed Firefox as well as the JRE a couple of times and tried re-installing in different order – no luck: the same error-message.

Since I remembered that sometimes unexplicable problems could be traced back to the profile-folder, I though why not just try it with a fresh profile – And I watched in awe that the problem was gone and applets loaded fine. But I had too many extensions and configurations and I didn’t really want to spend a half afternoon re-installing and customizing extensions and configurations, hence I decided to find the cuplrit: Create a new profile, copy the old profile in there, and then go on systematically deleting files until it works.

After a while it turned out that it was the prefs.js file that caused the Error. This was even more mysterious, since that file only holds userdefineable preferences, which really shouldn’t have any effect on how well (or rather if at all) the JRE works. But I did have some obscure old-extensions to set weird settings – so who knows. Now I wanted to know which Preference was causing the Error. And I didn’t want to believe what it turned out to be. So I created a new profile, and only added the line I narrowed it down to. And – behold – that indeed was the problem:


user_pref("general.useragent.override", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;)");

Yes, that’s right. Changing the Browser-Agent to IE seems to not only fool far-away webserver logs – it’s also fooling your local JRE. From the humble POV of a regular user, this looks to me like a really stupid thing to happen. When trying to reproduce the Error on my spare PC, I din’t even get an error-message any more – just blank space, where the applet should have been. If you want to try it yourself here are some applets:
http://java.sun.com/applets/

Update: Bug report #269948

Update2: Wow, this seems to be a duplicate of Bug 83376 which dates back to 2001. Too bad I was not able to find either that bug, or one of the other duplicates of it, or anything else on that issue. Why does searching for “Java” on the Bug query page not list the bug?


|