July 2nd, 2007

Developers embed Pro-Firefox/Anti-IE sentiments in their code

As a professional web application developer, I’m well aware of the challenges involved in coding for multiple browsers (and, even worse, older/buggier versions of those browsers). I also hate it when a website won’t behave the way I want it to, so I often end up viewing the source with FireBug, then messing around with the code.

If I just need to “fix” it on a one-time basis, I’ll just edit it with FireBug, but if I need it to behave better every time I visit the site, I’ll write a GreaseMonkey script (Incidentally, I use Platypus to generate a lot of my GM scripts. So easy!).

Sometimes, in the course of viewing/hacking up their code, I run across funny things that developers left in there. Here are a few of them that I’ve run across, which express the designers/developers’ browser preferences.

From viewing the source of a last.fm page:

<span class="iesucks" style="display: block">&nbsp;</span>>

[I just liked their css class name]


A friend sent this next one to me a couple months ago. I went and tried it, at the time, and I got the error message. But they seem to have fixed it since then. Anyways, this online icon maker page, when viewed in IE, would throw a javascript error when you moved your mouse over the editor component on the page.The funny part was the error message:

'shitty_IE_needs_this' is undefined

Ooh, I just noticed that this site was featured on my favorite geek humor blog, Worse Than Failure (formerly known as The Daily WTF). They’ve got a screenshot of it, so you can still see how silly it looked.


This last one was not found in source code, so it may or may not have been written by developers, but it sounds to me like it was. From Google Reader’s FAQ (bold/italics added for emphasis):

15. What are Google Reader’s system requirements?

For the best user experience, Google Reader requires an up-to-date browser. We recommend that you use Firefox (download: Windows Mac Linux) or Safari (download: Mac), but Internet Explorer will work too (download: Windows).

July 21st, 2006

IE javascript error: ‘null’ is null or not an object

I got this javascript error in IE 6, while trying to read about how to use the Microsoft Script Editor to debug javascript in IE:
MSDN : ‘JScript debugger Statement’

November 29th, 2005

IE Tab Firefox Extension is great!

The IE Tab Firefox Extension is awesome! It allows you to open the current page in a new tab, rendered by the Internet Explorer engine.

Although most sites work fine in Firefox, it’s an unfortunate fact of life that some sites are designed to work with Internet Explorer only. To deal with this, I’ve been using the IE View Firefox Extension, which allows you to open the current page in an Internet Explorer window.

It allows you to define a list of sites that will always open in IE, which is useful if you use Firefox as your primary browser, but frequently need to use some IE-only sites.

This new IE Tab extension allows you to configure the same kind of list.. sites that will always open in an IE Tab. It even supports Ctrl-leftclick to open the current IE Tab into a new Internet Explorer window, using the IE View extension! I highly recommend both of these extensions.

October 15th, 2005

Internet Explorer: explorer.exe versus iexplore.exe

For several months, my profile on my home desktop PC was behaving strangely. Over time, the one EXPLORER.EXE process kept growing and growing in resource usage (memory + handles + everything else, it seemed), until eventually it would crash. If I logged out once in a while, and logged back in, I got a fresh EXPLORER.EXE instance with no memory leak. This was not an ideal solution, but it worked for a while.

Well, I recently read an article in the IEBlog, which announced a beta version of the Internet Explorer Developer Toolbar. This toolbar is long overdue, and although I still prefer the Web Developer Toolbar extension for Firefox, this is a big step in the right direction! They do share some similar features, and I use both every day now.

I installed it on my work laptop just fine, but when I tried to install it on my home PC, the toolbar did not show up in IE. I logged in with my wife’s profile, and she (someone who doesn’t need such a toolbar) could open it just fine. But not me. So, I poked around for quite a while, using various tools such as these 3 freeware tools from Sysinternals: Filemon, Regmon, and ProcessExplorer.

I sat there and compared my laptop with my desktop, with all unnecessary processes stopped or filtered, and tried to watch the effects of toggling the toolbar on and off (On my PC, even though the toolbar would not display, it was listed in the toolbars context menu and could be toggled).

Eventually, I found a major difference. On my laptop, there was one main EXPLORER.EXE process, and then for every Internet Explorer window I had open, there was a separate IEXPLORE.EXE process. On my desktop, there was one EXPLORER.EXE process, and that was it. No matter how many IE windows I had open, it was all running inside one process.

I compared the options in my desktop and laptop network and system settings, because I remembered something in there about launching new processes (in Control Panel Folder Options View, a checkbox called ‘Launch folder windows in a separate process’). That was checked on both machines, but didn’t affect these web browser windows.

So I did some searching to find out how to change this, and eventually found a relevant message thread which, at the end of the thread (of course), referenced a useful solution.
Add this registry value (and the key, too, if it’s not there):

Key:
HKEY_CURRENT_USER\Software\
Microsoft\WindowsCurrentVersion\
Explorer\BrowseNewProcess
Value Name: BrowseNewProcess
Data Type: REG_SZ (String Value)
Value Data: Yes

Phew! Adding that key did the trick, solving both my Developer Toolbar problem and my memory leak problem.

October 4th, 2005

IE assumes .CSV is HTML, Firefox and Opera get it right. [part 2]

[…continued]

So, I decided to try to write a ‘bookmarklet’ (or ‘favelet’ as they’re sometimes called in the IE world), because I’ve been finding a lot of useful ones lately, and I often find myself throwing javascript into my address bar by hand to modify a particular page’s behavior. Before writing one myself, I searched for a while to see if it’s been done already. I wasn’t able to find any javascript code to transform a page of .CSV data into a more readable form (namely, an HTML table). I did find a CSV Converter page, which lets you paste CSV data into a textarea (or upload a file) and submit it to a CGI script, which returns the data as either HTML tables or WikiMedia format. I first tried writing a bookmarklet to submit the current page’s body to that CGI script.

But that didn’t work so well. Part of the problem, from what I could see, is that when IE rendered the page as HTML, the carriage-return/line-feed characters were replaced by a space. This presented a challenge for programatically parsing the CSV text, because now I had to know how many columns existed in the data, so I could figure out where to break the lines, so the table would have more than one row. (My earliest attempts produced a table with only one row, with LOTS of columns)

So, I ended up cheating a little bit, and requiring that the data in the first column on the second row will always be ‘IE’. Other than that, the bookmarklet I created can handle more columnns in the future, automatically.

Right click this link and add to Favorites/Bookmarks

If you’d just like to look at the code, click here to see it in a more readable form.

Well, wouldn’t you know it… this bookmarklet works in IE 5.01, IE 5.5, Firefox 1.07, and Opera 8.5, but NOT IN IE 6.0. The exact same browser whose shortcomings I was trying to work around. (The earlier IE versions also made the CSV == HTML assumption, but at least my bookmarklet worked in those versions). IE 6.0 did not generate any javascript errors when running the script, nor did it pop up its little security warning bar, or any other visible behavior. It just sat there.

I give up. Stupid IE.

To see the behavior (or lack thereof) of the bookmarklets above:

  1. right click it and add it to your favorites/bookmarks
  2. go to one of the CSV pages (all 3 files are the same–they just have different extensions):
  3. select the bookmarklet from your favorites/bookmarks list to run the script

Doing this with different browsers will unfortunately yield different behavior. If anyone can suggest how to make it work in IE 6.0, or how to fix it so it doesn’t require ‘IE’ to be the first value on the second line of the CSV file, I’d love to hear about it!