Firefox Code Glitch
Posted by Tom at 11.30.07
0 Comments
I have a riddle for you if you have the time.
Last week I found that my site was suddenly behaving differently in Firefox. Up until this point, it looked pretty much the same as Safari. But suddenly every piece of text had inexplicably become bold, and the spacing of my block-level elements was off. Way off. After some rapid refreshing in both browsers to see if something had momentarily glitched out and become cached, I realized the bug was much more permanent.
Thank heaven for Firefox and its myriad extensions.
Over the years, there have been a few extensions that I found critical, but haven’t been updated, X-Ray being chief among them. View Source Chart is another extension that keeps me from switching completely back to Safari. In order to use either of these I keep Nightly Tester Tools around for ensuring backward compatibility with these extensions that have fallen by the wayside…
So using X-Ray, I find that Firefox is rendering a bunch of these extraneous tags all over the page:
<strong><strong><div>
I thought somehow MovableType might be throwing extra code in by accident, right? But after viewing source in Safari I see that the tags that are present in Firefox just aren’t showing up.
How is that possible?
My MovableType install is set to render pages statically, so I presumed that this mysterious code was being injected by some script I added to my site. PHP? Nope. sIFR? Nope. Crazyegg? Nope. Twitter? NOPE. A savvy friend even recommended shutting down Firebug and Greasemonkey to rule those out… Not the culprits, either…
As our conversation progressed, talking to my developer-friend must’ve dusted some troubleshooting mojo off. I went back and looked at where the errant tags began and there it was. I had found my white whale code.
It turns out that I use a secondary “blog” install to publish my linked list (“The Chipper”) — as is common on various blogs that utilize MovableType. And in one of my links, I carelessly neglected to close off a strong tag in the topmost link. These links are brought in via PHP include and somehow not closing it off caused a bunch of (properly nested, mind you) strong and div tags to be generated and injected into the page, but only in Firefox.
Safari, on the other hand, was kind enough to ignore the mistake and go about its business. Yet Firefox felt compelled to actually add in code to compensate for an unclosed tag. Or so it seems… I’m no browser geek, so that’s about as far as I’ll speculate. If you have a more in depth explanation of what happened, I’m all ears.


Leave a comment