Sunday, January 11, 2009

#Web browsers in the beginning of 2009

The truth about Internet Explorer 7
As a regular Windows XP user, I've been testing many web projects that I'm working on with IE6 (SP2). Since IE is a browser that many people are supposed to use, I regulary check if the project has compatibility with it.
However recently I noticed that more and more new stuff isn't working quite well (or slightly out of order) with IE6. For example a button on a major site misplaced, flash player loading issues etc. So I've decided that I should upgrade to IE7. The download was 15MB. Installs ok. I did a test run. First impressions: very nice look on the buttons, text was blured by default with 'ClearType'. Some new cool settings...
But as soon as I started testing to see if those issues mentioned above are fixed not much happened. Everything was exactly the same. Lots of JavaScript in the console and blog pages which look exactly the same in Opera, Chrome & FF in IE7 had strange misplacement effects appearing all over the place . So what exactly is the IE6 to IE7 update? I have to say its similar to the update XP > Vista which I never intend to make for various reasons (But I've managed to configure Vista to run like XP on a laptop once). IE7 appears to be a fancy looking IE6. More and more developers are starting to completely ignore IE as a target browser. Well thats no good for the IE team because they would have to change a lot.

The 'innerHTML' issue in IE
The innerHTML property originated from the developers of IE at Microsoft. Its an excellent solution and it can be used instead of writing complex DOM code. 'innerHTML' treats all the nodes inside an object as a whole. If you say for example that you have a nested html tag structure... With DOM you can return the parent tag as an object by id or tagname and then via the innerHTML property you can assign the contents of this tag to a string variable. This makes things extremely easy now since you can modify this string (ex: add more tags) and then assign the modified string back to the html tag via the innerHTML property which basically will result a new structure. Sounds great! I often compare innerHTML to the PHP simpleXML extention which is also a great solution for parsing data without large sections of DOM code.

So...MS invented this awesome property but does it work under Internet Explorer? The answer is no ). IE6 returns the infamous "Unknown runtime error", IE7 does the same. Are there any workaround? Yes they are some, but this is an actual bug (described here) and some of the workarounds aren't exactly working. 'innerHTML' isn't an 'official' property but its quite fast and awesome. To sum things up MS invented something very good then their own browser has problems with it, while all other browsers get along perfectly with it.

The chrome fox in the opera
To test websites, I often run them on different browsers (Windows), so I have some ideas about how these browsers perform and what are their pluses and minuses. These are the browsers I'm testing with: Opera, IE, Firefox, Chrome. My desktop PC isn't the top of the benchmark table, but in a way that's a good thing (you can get better idea of the performance of certain software on lowend machines). It seems strange to me that some people at forums say: I run Vista on my super new computer and the OS only takes 1GB of my RAM. Well...1GB for what exactly? Your OS should take around 200MB of RAM or so. Now the same applies to how browsers should work. A browser should not be a 'CPU hog' and should not take all your RAM away. There should be absolutely no reason for doing so unless its rendering some heavy graphics in realtime or if its compiling something. Also there should be options to disable the functionality which is creating this need for extra resources.

I have to say that I'm a recent Opera to Firefox convert. I'm still a big Opera fan and I follow its development closely. Opera is the fastest and the most light browser out there but I had a lot of problems loading websites with some footprint AJAX. So I've switched to FF as my default (Most dev writes for FF as their default target btw). But then...I had the issue of huge memory leak with FF. So I had to fix this with a 'hidden' setting (in a way its not that easy for some users to find this setting without googling on the subject). I think the same solution to the problem is explained here. This issue almost send me back to Opera.

I also monitor the development Google's new Chrome browser. They have a great technology concept and a lot of unique features. So far, I'm seeing it as a faster and lighter alternative to FF. The 'import' settings from different browsers is cool too. And everything seems to open properly. But its quite stripped down and there is something very strange! If I open Youtube for example and then my mail account on another window the cpu usage goes up to 40%!?. There must be something really expensive and hidden going on (probably some sort of caching which is absolutely unnecessary). The options menu of Chrome are very simple so there is no function to disable this behavior. I have great respect for Google and I believe they will eventually add a function to disable extras.

So to sum this up: IE needs lots of work (DOM2 compitabuility, lots of bugs), Opera definitely still needs some work to support the new technologies, FF uses way too much RAM by default, Chrome needs more settings so that the user can turn of the so called 'inovative' stuff.
We end up with a slightly broken set of tools...I'm currently using a tweaked Firefox. But don't get me wrong all of the listed browsers can do their job but IMHO its just silly when you visit a site with IE and the site dev hasn't added support for it. Or when you use fresh installed FF and your RAM usage meter shows 400MB ram if you open a couple of video sites.

The future is bright
I think that all browser author companies's goal should be: To show contents of the Web in exactly the same way, while sticking to the same standards and not to force website developers to write extra code for browser compatibility. And I'm seeing more and more of that which is a very good thing. The frustration of website developers (including myself) may be eventually reduced to minimum. We shall see.