Netscape 4.x bug tickled by www.microsoft.com

[Originally written October 31, 2000; see update at bottom]
Recently, fr.linuxtoday.com reported that www.microsoft.com was rejecting all non-Windows browsers, redirecting them to a blank and buggy page.

The problem seems to appear only on Netscape 4.x, and only on Linux, and only for some people. It is triggered by javascript that executes a statement like

document.write('<div style="display:none;"></div>');
in the file http://www.microsoft.com/library/toolbar/toolbar.js, which is invoked by Microsoft web pages to set up their menu. For some reason, executing this particular statement during page loading drives Netscape 4.7x bonkers.

Bug present but masked under Windows

Going to www.microsoft.com with Netscape 4.7x under Windows seems to work properly, but 'view source' reveals that the javascript bug exists here, too; it just doesn't corrupt anything important. Here's an excerpt showing the text inserted by the javascript statement:
<LAYER visibility="hide"><DIV style="display:none;">
<IMG src="http://c.microsoft.com/trans_pixel.gif?source=www&TYPE=PV&p=&r=http%3A//www.kegel.com/jbug.html"
height="0" width="0" hspace="0" vspace="0" Border="0"></DIV></LAYER><DIV
Ttyle="display:none;">
Notice that bogus DIV Ttyle="display:none"? That shouldn't be there. For some reason, under Linux, the page terminates right after that bogus code; perhaps the Linux executable inserts a null byte, who knows. Under Windows, Netscape at least continues on with the page.

Demo

Here are four demonstrations of the bug, in order of decreasing size: All four should display a page blank except for the word "Hello" in the upper left. The first two should also display an alert with the word 'spam'. They do in fact behave this way under IE5 or Netscape 6 PR3.

Under Netscape 4.7x on either Linux or Windows on my machines, here's how they behave:
With Javascript disabled, all show "Hello" properly (of course, there is no alert, since that is done with Javascript). With Javascript enabled, all show a blank screen instead of the correct "Hello", and the first three also show a Javascript error. This happens even on Windows.
www.microsoft.com shows both symptoms, but only under Linux.

Suggestions

Netscape should fix their bug. I guess now that Netscape 6 is out, that does officially fix the bug.

In the meantime, Microsoft should change the routine buildIMG() in http://www.microsoft.com/library/toolbar/toolbar.js to use some other means of hiding their tracking web bug. The div tag with style="display:none" seems to trigger a Netscape bug.

Resolution

[December 11, 2000]
It seems that Microsoft implemented a workaround on their website, by changing their toolbar.js to not call buildIMG() if the client is a Unix version of netscape:
if (navigator.userAgent.indexOf("SunOS") == -1 && navigator.userAgent.indexOf("Linux") == -1) {
	buildIMG(a);
}
This is overkill, as the javascript worked fine on Netscape 6, but since it only affects their hit tracking system, it's fine for the user, I think. Kudos to Microsoft for fixing this.

Comments Received

One fellow wrote:
You are one of a VERY few sites I have found that comment on the NS4 'Ttyle' error.

I just wanted to comment that (wierdly enough) when I include a 'width=100%' (or any other width) element to the style, the 'Ttyle' error disappears.

Thanks for your page, it helped convince me that I wasn't going insane.


[Back to www.kegel.com]
Dan Kegel