Showing posts with label Internet Explorer. Show all posts
Showing posts with label Internet Explorer. Show all posts

Tuesday, 7 May 2013

Internet Explorer virus used to attack US nuclear weapons researchers

Internet Explorer virus used to attack US nuclear weapons

By Dark Politricks

From the popular alternative news site darkpolitricks.com comes the news that the "most popular browser in the USA - yes IE 8!" has been used by hackers to infiltrate US nuclear weapon researchers computers in America.

Apparently zero day exploits were used, as well as a virus on a popular website frequented by members of the nuclear weapons industry.

The hack was only discovered after an unknown number of computers became infected with a backdoor Trojan that was reportedly installed on the machines of web surfers who used IE 8 to navigate to a specific page on the US Department of Labor website.

"The Department of Labor site was rigged to redirect users to another site that infected computers with an iteration of the infamous "Poison Ivy" Trojan, which was able to avoid detection by all but two major anti-virus products,” Ben Weitzenkorn wrote Monday for TechNews Daily."
According to Microsoft, "The vulnerability may corrupt memory in a way that could allow an attacker to execute arbitrary code in the context of the current user within Internet Explorer."

Why IE 8 is still the most popular browser in the USA I have no idea. Have they not heard of Chrome, FireFox or even IE 9?

We all know IE 6 was a danger to itself, it's users and everyone else around it.

This was due to the severe amount of security holes in the code and the large number of hacks that had to be used to make websites work in it. This was both by CSS designers and JavaScript developers who had to come up with the many frameworks we are now left with. All just to make a standards compliant webpage work in IE and normal browsers.

Just think if it wasn't for IE 5 and IE 6 we probably would have never even heard of jQuery, Prototype, addEvent functions and hacks to get uncommon browsers working on your PC like window.opera and user-agents that are so full of shit they have lost all meaning to anyone.

You can view the full article US nuclear weapons researchers targeted with Internet Explorer virus at the popular #altnews site darkpolitricks.com.

Thursday, 26 April 2012

Troubleshooting Internet Wireless Connectivity Problems

Quickly diagnosing Network Issues on your Windows XP PC

If you are like me and have a WinXP laptop at home then you will miss some of the nice diagnostic features Windows 7 comes with (we will skip Vista for obvious reasons) - By the way I have finally got a Windows 7 machine at home and at work!

I like WinXP purely because it lets you do what you want without all those annoying pop ups asking you to confirm everything you want to run.

However the other day for some reason I opened my laptop only for my Internet connectivity to be disabled with the message that the relevant driver was no longer installed! Why I have no idea as I had been using the laptop only hours before without an issue.

No I hadn't accidentally turned off the Wireless switch at the top of the Sony Laptop or accidentally disabled the radio from the utility and a quick virus scan using my last update showed nothing untoward.

The Intel Wireless Troubleshooter had all the options greyed out and the Windows Wireless Network Manager wasn't even in the task bar for some reason so I couldn't check the repair function on that either.

However (and this might be obvious to people who know) but there is a little tool you can run from your Start Menu which will diagnose any network issues and fix them if it can. This is probably the same tool that Windows Messenger uses when you use their own diagnostic tool.

To run this tool do the following:

  • Go to the Start Menu
  • Choose the RUN option
  • Enter the following into the input box: %windir%\network diagnostic\xpnetdiag.exe
  • Hit OK
If it can fix the problem it will tell you and if it can't then you will need to look deeper e.g check your router, check your inbound Internet connection and make sure there isn't a local Internet problem in your area.

The diagnostic log that I got looked liked this:

Last diagnostic run time: 08/20/11 13:33:34 HTTP, HTTPS, FTP Diagnostic

HTTP, HTTPS, FTP connectivity



info HTTP: Successfully connected to www.microsoft.com.

info HTTPS: Successfully connected to www.microsoft.com.

info FTP (Passive): Successfully connected to ftp.microsoft.com.







DNS Client Diagnostic

DNS - Not a home user scenario



info Using Web Proxy: no

info Resolving name ok for (www.microsoft.com): yes

No DNS servers



DNS failure









Gateway Diagnostic

Gateway



info The following proxy configuration is being used by IE: Automatically Detect Settings:Disabled Automatic Configuration Script: Proxy Server: Proxy Bypass list:

info This computer has the following default gateway entry(ies): 192.168.1.1

info This computer has the following IP address(es): 192.168.1.5

info The default gateway is in the same subnet as this computer

info The default gateway entry is a valid unicast address

info The default gateway address was resolved via ARP in 1 try(ies)

info The default gateway was reached via ICMP Ping in 1 try(ies)

info TCP port 80 on host 207.46.19.254 was successfully reached

info The Internet host www.microsoft.com was successfully reached

info The default gateway is OK







IP Layer Diagnostic

Corrupted IP routing table



info The default route is valid

info The loopback route is valid

info The local host route is valid

info The local subnet route is valid

Invalid ARP cache entries



action The ARP cache has been flushed







IP Configuration Diagnostic

Invalid IP address



info Valid IP address detected: 192.168.1.5







Wireless Diagnostic

Wireless - Service disabled



Wireless - User SSID



action User input required: Specify network name or SSID

Wireless - First time setup



info The Wireless Network name (SSID) to which the user would like to connect = BLAH

Wireless - Radio off



info Valid IP address detected: 192.168.1.5

Wireless - Out of range



Wireless - Hardware issue



Wireless - Novice user



Wireless - Ad-hoc network



Wireless - Less preferred



Wireless - 802.1x enabled



Wireless - Configuration mismatch



Wireless - Low SNR









WinSock Diagnostic

WinSock status



info All base service provider entries are present in the Winsock catalog.

info The Winsock Service provider chains are valid.

info Provider entry MSAFD Tcpip [TCP/IP] passed the loopback communication test.

info Provider entry MSAFD Tcpip [UDP/IP] passed the loopback communication test.

info Provider entry RSVP UDP Service Provider passed the loopback communication test.

info Provider entry RSVP TCP Service Provider passed the loopback communication test.

info Connectivity is valid for all Winsock service providers.







Network Adapter Diagnostic

Network location detection



info Network location could not be detected

action User input required: Select network location

info Using home Internet connection

Network adapter identification



info Network connection: Name=Local Area Connection, Device=Marvell Yukon 88E8036 PCI-E Fast Ethernet Controller, MediaType=LAN, SubMediaType=LAN

info Network connection: Name=Wireless Network Connection, Device=Intel(R) PRO/Wireless 3945ABG Network Connection, MediaType=LAN, SubMediaType=WIRELESS

info Network connection: Name=1394 Connection, Device=1394 Net Adapter, MediaType=LAN, SubMediaType=1394

info Network connection: Name=Strategies VPN old, Device=WAN Miniport (PPTP), MediaType=TUNNEL, SubMediaType=NONE

info Network connection: Name=Strategies VPN, Device=WAN Miniport (PPTP), MediaType=TUNNEL, SubMediaType=NONE

info Both Ethernet and Wireless connections available, prompting user for selection

action User input required: Select network connection

info Wireless connection selected

Network adapter status



info Network connection status: Disconnected

info Network adapter hardware problem: This device is disabled.

warn Network adapter status not healthy

action Automated repair: Enable network connection

action Enabling the network adapter

info Network adapter successfully enabled

info Network connection status: Connected







HTTP, HTTPS, FTP Diagnostic

HTTP, HTTPS, FTP connectivity



warn HTTP: Error 12007 connecting to www.microsoft.com: The server name or address could not be resolved

warn HTTPS: Error 12007 connecting to www.microsoft.com: The server name or address could not be resolved

warn FTP (Passive): Error 12007 connecting to ftp.microsoft.com: The server name or address could not be resolved

warn HTTP: Error 12007 connecting to www.hotmail.com: The server name or address could not be resolved

warn HTTPS: Error 12007 connecting to www.passport.net: The server name or address could not be resolved

warn FTP (Active): Error 12007 connecting to ftp.microsoft.com: The server name or address could not be resolved

error Could not make an HTTP connection.

error Could not make an HTTPS connection.

error Could not make an FTP connection. 


If like many people you have now moved onto a newer operating system like Windows 7 then you can take advantage of their inbuilt network troubleshooter which can be accessed by following this guide:

  1. Click the Start button.
  2. Click the Control Panel‌.
  3. In the search bar in the top right corner enter "Troubleshooter".
  4. Run the search and click on "Troubleshooting" in the list of results.
  5. Click Network and Internet
  6. Pick the type of problem you are having and it will run a diagnostic test for you. If you are having internet connectivity issues then you should select the first option "Internet Connections"

For more information on troubleshooting internet and wireless connectivity problems on Windows 7 machines read this step by step guide on troubleshooting connectivity problems.

Tuesday, 10 January 2012

Problem with Google Chrome and Twitter

Google Chrome 16.0 and Twitter Direct Message Problem

First, I can't believe my version of Chrome is now on 16.0.912.75. It seems like only yesterday I had Chrome version 1 and it didn't change for a good while.

Unlike Internet Explorer which refuses to force automatic updates on their browser users which mean developers still have to cater for IE 6 and non standard compliant code due to IE 9 not being available on Win Vista or XP. I do appreciate that they automatically upgrade the browser when required.

However it does seem like FireFox (version 9.0.1 I am currently on now) and Chrome are in some kind of race to see who can get to version 100 first. I haven't exactly noticed many differences between all these nightly version changes so it must be bug fixing as if it isn't I have no idea what it is apart from security hole patches.

Anyway, I recently got a new laptop for work (a DELL, 64bit, quad core i5 Win7) which is good APART from the horrible, horrible flat mouse pad which seems to go into sticky scroll mode a lot. You know when suddenly the mouse cursor turns from a pointer into cross-hairs and as you move the cursor the whole page scrolls with it.

Tonight I noticed an issue with this and Twitter's new format for Direct Messages which open in a draggable DIV popup.

I went to write a Direct Message and the cursor went into sticky mode. I couldn't remove the mouse cursor from the pop div as wherever it went so did the popup box. Very annoying.

What was interesting was that as soon as this issue occurred my CPU and Memory for the Google Chrome.exe *32 process went shooting through the roof and my laptop turned into a helicopter. I honestly thought the machine was going to take off it was that loud from the hard-drive spinning away.

The only solution was to move the cursor off the webpage to the toolbar and kill the page totally and as I did the CPU and Memory dropped like a stone from a cliff.

This is obviously an issue with DELL's mousepad but it reminded me of an issue I had with my own HTML WYSIWYG editor which was a pop DIV you could drag about the screen.

The editor had a couple of listboxes on it for selecting fonts and sizes etc but because I had a a drag event attached to a mousedown and mousemove event it meant that you could never actually open the list and scroll it down to the bottom as if you did all that happened was the Editor moved around the screen.

It was a simple drag n drop solution which was fired by a mouse down event setting a flag so that when set any mouse move event moved the referenced DIV until a mouse up event set the flag off.

I got round the problem at first by just making the top and bottom sections of the DIV container for the editor draggable which did fix the issue but in the end I settled for what is getting more common as a solution for the old pop up window, the lightbox.

I don't know why Twitter need to make their new message pop div's draggable as they change the backgrounds opactity like a lightbox anyway so I don't see the point in the draggable effect at all.

I know it would certainly help with my DELL's sticky mousepad problem!

Wednesday, 31 August 2011

Would you switch back to IE9 now that they have finally made a good browser?

Now that IE9 is standards compliant and actually good will you switch back to using it?

A few months ago I wrote an article about why I hated debugging in IE8 which revolved around their single threaded event model (window.event) and the delay it took before debug messages were outputted to the console.

A member of the Microsoft team commented that he had run the test case I had created in IE9 and that it had run perfectly. No high CPU, no frozen console, no high memory usage or other performance problems at all.

As you cannot install IE9 on WinXP, which is what I use on my home laptop (due to Vista being shite), I haven't had the pleasure of using Internet Explorer 9 a lot until I installed Windows 7 on my work PC.

I have to say that Windows 7 is actually a great operating system and I especially love the way it has incorporated many of the features of clean up and performance tuning tools like Tune Up Utilities and CCleaner into the main OS.

I also have to say that Internet Explorer 9 is the first IE browser I actually like.

Not only is it blindingly fast they have finally listened to their customers who have been complaining for years and made their JavaScript engine standards compliant.

Obviously this makes the Browser / Document mode spaghetti even harder to detect and I haven't been able to find a way as of yet to detect IE 9 browser mode running as IE 8 or 7 on 32 bit machines but that is not a major issue at all.

What I am wondering though is that now that IE9 is actually a good browser, with a good inbuilt development console and element inspection tools, how many developers will actually return to using it either as their browser of choice for surfing the web or for their primary development.

My browser development survey which I held before IE9 was released showed that developers would rather use Chrome or Firefox for surfing and would also always choose the development tools that those browsers bring than use IE 7 or 8.

I know that I changed from using IE to Firefox as my browser of choice some eons back and I changed from Firefox to Chrome for both surfing (speed is key) and developing (no need for Firebug or any other plugin) the other year when Firefox started to suffer major performance problems.

These performance problems are always either to do with having far too many plugins installed. Setting the browser up to check for new versions and any installed plugins on start up which cause long load times, Firebug issues and errors in the Chrome source. This is on top of all the constant problems that Flash seems to bring to any browser.

I use Chrome for surfing due to it's speed but if I leave a few tabs open all night that contain pages running Flash videos then by morning my CPU has flat-lined and memory has leaked like the Titanic.

This is more a problem with Flash than Chrome and I try to keep this browser for surfing as clean and as fast as possible by not installing plugins. Then if I need to hack around or do some hardcore web development I will use Firefox and all the great plugins when I need to.

I don't think I could really get hacking with Chrome alone as when I am really getting stuck into a site I need my key plugins e.g the web developer toolbar, hackbar, header modifier, Request and Response inspectors e.g HTTP Fox, Firebug, ColorZilla, YSlow and all the Proxy plugins that are available.

However for basic development, piping out messages to the console, inspecting the DOM and checking loaded elements and their responses then Chrome has everything Firebug has without all the JavaScript errors.

In fact it's surprising how many developers don't even realise how much is possible with Chrome's inbuilt developer tools, speed tests, header inspectors, element inspectors and DOM modifiers and other great debugging tools that used to be the preserve of Firebug alone.

Which leads me back to IE9.

Yes it's fast and it's developer tools are okay with options to clear cookies, disable JavaScript, inspect the DOM and view the styles but it's no Chrome or Firebug yet;

Therefore what I want to know is how many people (and by that I mean developers) will switch back to using Internet Explorer 9 for pure web surfing?

For sure it's fast, supports the latest CSS standards and all the great HTML 5 features that we have all seen with floating fish tanks and the like. But is this enough for another browser switch?

I have all the major browsers installed at work on Win7 including IE9, Firefox, Chrome, Opera, Safari, SeaMonkey and a number of others I cannot even remember the names of they are that obscure.

Before upgrading I even had Lynx and Netscape Navigator 4 installed as I used to be so anal that any code such as floating DIV's had to work in the earliest browsers possible. However I only use these browsers for testing and I stick to Chrome (for surfing) and Firefox (for hacking) which leaves little room for IE9 at the moment.

I know it's a good browser. It's standards compliant and it no longer crashes when I try to output anything to the console so why shouldn't I try it again.

Maybe one of my readers can help me decide on the browser of choice for surfing and development and how IE9 fits into that toolset.

Maybe I am missing some really cool features that I would use all the time but to be honest I am not into throwing sheep at randoms or constantly voting sites up and down and writing comments on them. Therefore for me to switch back from Chrome to another browser such as IE9 there has to be a really good reason for me to do so.

So does anyone have any reason why I should re-consider using IE9 at work for my web surfing or development?

Thursday, 27 January 2011

2011 Browser Usage Stats

Browser Coverage and Other Visitor Statistics

I like to regularly check one of my largest systems web traffic stats to see what kind of browsers our users are visiting with and I have previously posted reports which have showed IE maintaining its position at the top of the stats every time.

One of our sites is used by a large corporate company that heavily restricts the type of browser their workers can use to access the Internet which means that they have to use IE 6 but even accounting for that it surprising to see that IE 6 is still at the top of the browser usage report even though IE 8 has been out for a long time and IE 9 is on the way.

One other reason I can think of that explains why so many people are still using IE 6 is that it seems to be the useragent of choice for spoofers and hackers. I have an automated system that I have built that logs, identifies, and then bans these bad bots and users and I have built up quite a large database of known IP / Agents so I can regularly check to what kind of tricks they are up to.

The latest batch of hackbots that I have spotted are using stripped down URL Encoded HTML without quotes for attributes and without protocols in the links e.g



%3C%69%66%72%61%6D%65%20%73%72%63%3D%2F%2F%73%6F%6D%65%64%6F%64%67%79%73%69%74%65%2E%72%75%3E


When URL Decoded becomes


<iframe src=//dodgysite.ru>

Even though there are no quotes around the src attribute and no protocol at the beginning of the URL this HTML will still work and is a common technique used by minifiers (including Google) to cut down on the size of HTML files.

Obviously the whole point of this is to beat injection and hack tests that rely on pattern matching in a similar way to those sql injection attacks that are all uP aNd DoWn aiming to beat people who have forgotten to make their systems sql injection detection routines case insensitive.


Any how here are the latest browser usage reports for the first month of 2011


Top Browsers

BrowserUsage %
IE 6.048.12
IE 8.016.04
IE 7.012.14
Firefox 3.66.71
Chrome 8.04.82
IE 5.54.31
Safari 5.01.83
Firefox 3.01.06
Firefox 3.50.97
Safari 4.00.41
Opera 9.00.36
Opera 8.00.36
iPhone 4.20.34
Firefox 2.00.31
Mozilla 1.90.26
Iceweasel 3.00.26
iPhone 4.10.22
IE 9.00.21
BlackBerry0.19



Top Operating Systems

Operating SystemUsage %
WinXP68.30
WinVista10.20
Win10.12
Win20004.87
MacOSX2.90
iPhone OSX1.23
Win20031.14
Linux0.66
WinME0.49
Win980.47
Debian0.26
WinNT0.24
Android0.22
BlackBerry0.17

Saturday, 21 March 2009

Problems Upgrading to IE 8

Upgrading to Internet Explorer 8.0

There are plenty of sites already out there listing all the many bugs or "features" that IE 8 has brought to the table but so far the two main ones I have come across are:


Problems when FirebugLite is also running in IE 8.

I was getting a "Function Expected" error on line 1499 in the IsArray function. As a workaround I added the following line as the first line in the function e.g



IsArray:function(_object){
if(!_object) return false;



This prevents the error but the Firebug-lite console does not display correctly in IE 8 when the document mode is also IE 8. To get round this I set the document mode to IE 7 and then it works fine.

Remember IE 8 now has a console in the developer tools options for outputting custom debug messages plus its now got a great debugger tool with all the same features as Firebug so Firebug-Lite isn't really needed anymore. However it should still be possible to run the two side by side.


Issue with clip and rect function

I also found an "invalid argument" error when setting the clip properties using the rect function. The code was for a scroller and the original version that raised the error was:



this.canvas.style.clip = "rect(0 " + this.canvasWidth + " " + this.canvasHeight + " 0)";



The fix was to add "px" after the dimension values and separate the values with commas e.g



this.canvas.style.clip = "rect(0px, " + parseInt(this.canvasWidth) + "px, " + parseInt(this.canvasHeight) + "px, 0px)";



I have come across a few errors such as "null is null or not an object" (you don't say!) which have been simple fixes and have just required testing the values correctly before using them.

I am sure there are hundreds more errors and that many many hours will be devoted to fixing them all in a similar manner to the last 2 major releases of IE. However overall I am very happy that they seem to have caught up with Firefox and the others and have implemented a pretty decent developer tools section including a great debugger that actually gives you a useful error message for once. Plus I like the fact that the GUI hasn't changed very much in the way that IE 6 to IE 7 did and I do like the little touches like the accelerators.

However its a shame that with such a major release they couldn't have gone the whole hog and sorted their Javascript engine out to make that standards compliant as well as the CSS. Apparently they have rewritten the whole JS engine so now was as good a time as any to bite the bullet and do it and they would have made the whole web development community very happy if they had done so. Even with the rewrite their event model is still pretty shoddy and even if they wanted to keep with their intermediary event model (attachEvent, removeEvent, returnValue, srcElement etc) then they could have fixed those annoying little issues that people have spent thousands of development hours resolving such as the this keyword referring to the window and not the object in question and attaching event listeners in order rather than randomly.

It seems pretty likely that more and more companies will get to the point where developing for IE becomes too much work and stop supporting it. Market share of Firefox, Chrome, Safari and Opera are increasing all the time so it may not be that long until you find a lot of sites just redirecting to a Mozilla download page when you access their site in IE. If that does happen then it might be a shame to some people but Microsoft will only have themselves to blame and may find that they have missed a great opportunity with this release to prevent that from occurring.

Thursday, 18 September 2008

What browser support do you offer your users.

Graceful degradation

In an ideal world you would want any website you develop to have the largest audience as possible. Sites these days can rely on multiple technologies to work (Javascript, Flash, Java, ActiveX, CSS) most of which the user can disable through choice even when their browser supports it. This means that when it comes to developing a site you have the decision between drawing a line in the sand and saying you must use this browser above this version and have JavaScript, Flash and ActiveX enabled for it to work which will mean a small and very annoyed audience. Or the better way which is to build the site from bottom up starting with a good HTML core structure that should work in all browsers and then add layers of functionality on top.

This means making sure all links have href tags that point to URIs and not Javascript: , images have alt tags, client side validation is duplicated on the server (which is good practise anyway to prevent hackers avoiding it by disabling javascript) and that the core navigation is not reliant on Javascript to work. This is called graceful degradation and ensures that your sites core functionality is available to as many users as possible.

For example if you were displaying flash banners you would start with an image that had alt tags defined so that if the user has a text based browser they read the content within the alt tags. If they have image support they would see the image but if they had Flash enabled they would view the movie.

The site I am currently working on divides browser support up into 3 levels and to help the user we include a browser compatibility page that lets the user see what level of support their browser settings are providing them along with links to let them download the latest version of their browser if they are using an old version. As well as showing the browser support level (see below) the page lists a number of key settings and features that the site makes use of with an indicator of whether this feature is enabled or not. Settings displayed include Flash, JavaScript, AJAX, Java, Cookies etc. Having one or more items on this feature list unavailable does not mean the site will not function only that certain parts of the site use this technology and therefore to get the richest experience from the site and enjoy all the functionality they should enable those missing features. Obviously there are some items that have to be available for the site to work such as forms and session cookies and we let the user know whether their browser and settings are compatible with the site by showing them crosses or ticks next to each item and an overall compatibility rating.

Browser support levels

The browser support grades are defined in the following way.

Leval 1 Support
This means that the site should be fully functional and display correctly. We will test the site fully in level 1 browsers to make sure any bugs are fixed as soon as possible. Currently our level 1 browsers are IE 7,6, Firefox 2 (3 still buggy), Safari 3, Opera 9.

Level 2 Support
This means browsers that should work without any problem with our software but as we cannot test every single available browser we cannot guarantee that everything will work. For example if the browser is the latest version of SeaMonkey or Firebird which is based on the same Gecko rendering engine that Firefox is (which is a level 1 browser) then the system should work perfectly depending on your browser settings. However as we do not fully test
the system with this browser we do not guarantee it will work 100%. Current level 2 browsers would be Firefox 3, Opera 8, Sea Monkey, Konqueror.

Level 3 Support
This means older or niche browsers such as PDA/Mobile phones that we do not test the system on. This is not to say the system won't work as it might do depending on your browser settings. However we are not going to test our system on Netscape Navigator 4 or every mobile phone to ensure it works.

A fully functional site means no Javascript errors however the Javascript is not really a problem as most code that works in IE 7 is going to work in IE 5 and we all try to write cross browser code nowadays which is made easier with all the libraries available. The issue is more to do with CSS and all the quirks between IE/Mozilla and the various versions. IE 6 for instance has a number of major differences which means special stylesheets or hacks have to be implemented. As much as we would like to downgrade IE 6 to a level 2 browser we cannot due to the simple fact that a number of our largest clients still use IE 6 as their browser. We have enquired about the possibility of them upgrading but were actually told that their technical support team would not allow them to which is understandable if you consider how much support time would be taken up by requests of help because of the new browser layout. I can imagine don't want to suffer the hundreds of phone calls asking "where has the history menu disapeared to."

I also have Firefox 3 in level 2 due to the fact that there are still a number of outstanding issues with the site which need resolving before we would make it level 1. Some of these issues are definitely a problem with the browser such as the well known problem of playing Flash videos which an upgrade to version 10 is the only workaround I have found. There is also an issue with the execCommand function which I am not sure about as the code worked fine in Firefox 2 and other browsers but has suddenly started giving me Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLDocument.execCommand]" errors in an iframe based wysiwyg editor the site uses.

Current browser usage

I like to occasionally look at the traffic statistics to see whether our grading of browsers over 3 levels is in keeping with actual Internet use.

The system I am logging against is recording on average 350,000 page loads a day at the moment roughly 50-60% of which are from crawlers which is nothing out of the ordinary. So looking at the traffic from those site members who have logged into the website as opposed to just visitors the browser breakdown for this month so far is:

Browser %
IE 7.0 61.56
IE 6.0 27.21
Firefox 3.0 5.44
Firefox 2.0 3.06
Safari 3.1 2.72

Which is no great surprise and shows how much of a market share IE 6 still has even after 2 years of IE 7 being around.

As for obscure and old browser versions would you be surprised or not to know that for today only the following browsers appeared in the stats for all non-crawler traffic:

  • 62 different people used IE 5.0 and 1 came along in IE 4!
  • 5 visited on various versions of Netscape Navigator 4.
  • Overall users to the site Yandex the Russian search engine came third after IE 7 and 6.
  • There were over 100 different types of browser/version recorded today alone.

Although not earth shatteringly exciting it does show the breadth of browser types available and also that a large majority of the users out there do not seem upgrade very often, some not at all by the looks of things. With new versions of browsers rolling out all the time it would be physically impossible to test a site in each one but if your site works in the major 4 rendering engines (IE/trident, Firefox/Gecko, Safari/Webkit, Opera/Presto) then you will be covering the majority of those users who do keep up to date with browser revisions.

Sunday, 14 September 2008

My growing love for Javascript

A shaky start to the love affair

I have no shame in admitting that I am currently in love with JavaScript. It may be that for the last eon or two I have been working with clunky old scripting languages such as ASP classic and whenever I get a chance to do some JavaScript I grab it with open arms as an opportunity to do what seems like proper programming. I will be the first to admit that I never used to see JavaScript in the way I do now and as well as never understanding its full potential I never even thought of it as a proper object orientated language which it most certainly is. When I first swapped over from client / server applications in the early 90's to web development using ASP/COM/SQL Server 6 JavaScript was just a nice little scripting language that could set the focus of inputs, validate input client side and other little tweaks that didn't seem of much importance in the grand scheme of things. The "proper" coding was done server side and I would have traded my ciggies by the dozen with anyone to work on a stored procedure or COM component than have to fiddle round with a scripting language that I had little time or patience for.

Coming from a VB background I hated the problems of case sensitivity and having to remember that equality tests involved more than one equals sign, sometimes even three. Trying to debug a script was always a nightmare having to sit there clicking away all those alert boxes before realising you were in some sort of never ending loop and having to kill the browser and start again. Yes I really didn't think much of it and I am certainly not alone in feeling like that.


The love that grew from necessity.

So over the years my views on JavaScript changed from hatred to a mild respect still outweighed by all the annoyances that come with trying to write a fully functional script that is complex and cross browser at the same time. I still didn't have to work with it that much apart from replicating any server side form validation on the client and some mild DOM manipulation. My annoyance with the language itself had disappeared after I had learnt Java and C# and the scripts that I did have to knock out were not that complex however I still had an attitude that if it worked in the browser that I was using which was always the latest version of Internet Explorer then the script was fine by me. If it didn't work in Netscape or Safari then I would just ask the office "Javascript Guru" to have a look and the code I was given usually seemed to work even if I didn't know what it was doing. Then the other year I wanted to implement a WYSIWYG editor for the system I was working on. The system was currently using the FCKEditor and I wanted to implement what seemed like a simple request at the time a character counter so that as the user typed the number of characters used in the HTML source was available for viewing. I remember trying to edit the FCK source and realising what a huge beast it was. The size of its directory was ten times the size of the rest of the site. I was sure that half the code and possible functionality was not required for my systems requirements. I had a look at some other widgets including OpenWYSIWYG and another one that our Javascript guru had used and then I decided to write my own combining the best bits of each, stripping out anything not needed, adding my bullet counter and making it as flexible as possible. It seemed like a straight forward task on paper but it was the start of a painstaking development but more importantly it was the start of a long learning process which although extremely painful at the time opened my eyes to the wonders of cross browser coding and all the different caveats and pitfalls that were waiting for me to discover.


Items of interest discovered along the way.

Whilst developing this widget some of the most seemingly simple things turned out to be some of the most complex. Who would have thought just putting a cursor at the end of any content in the IFrame editor would be such a tall order. So as well as learning far too much about browser differences and the history of Netscape and Mozilla and why User-Agents seem to make little sense I found out some very important information and came across some specific problems that everyone comes across at some stage when developing cross browser script.

1. How Firefox is indeed a wonderful invention with all those extensions especially Firebug which made my debugging life pain free once again. Not only that but Firebug lite brings most of that joy to debugging in IE. No more tired fingers from closing alert buttons.

2. The problems with relative URIs displayed within Iframes in Internet Explorer. Read this article for an explanation. The solution was to write out the Iframe content with document.write.

3. Different implementations of content editable HTML between browsers. Issues setting design mode on in Mozilla and disappearing event listeners. All good fun for the clueless I can assure you.

4. All the fun involved in learning about the event model and the problem of "this" keyword in IE as well as the memory leakage in older IE versions and the illogical ordering IE fires events in.

5. Differences between browsers when trying to calculate the size of the viewport and window dimensions for making my editor appear in a floating div.

6. Trying to make the content outputted by the editor as consistent as possible across browsers and XHTML compliant. IE seems to love capital letters and forgetting to close LI and DT elements for some reason.

7. Much much more.

So as you can see if you have yourself covered all those topics in detail, which means you will most certainly have read Dead Edwards competition blog article from start to finish as well as follow most of the links it leads to, this is a lot of information to take in and understand. However rather than put me off JavaScript for life its actually made me come to love the bloody thing.


Conclusion

So whereas in the 90's I used to hate all those cross browser problems they are more of a challenge to be overcome now and I love it when I get a complicated piece of code working in the main 4 browsers as well as many old versions as possible. In fact I may get a little too keen sometimes and often need my colleagues to tell me that the widget doesn't actually need to work in Netscape Navigator 4 or IE 4.

I am one of those people who will readily admit that I don't know everything but I like finding out about those missing chunks of knowledge and when given the choice of an easy life by implementing someone else's code as is will now often choose the more painful but also more enjoyable option of trying to write my own version. I will have a look at some of the best examples out on the web and try to put them all together which is usually the best way of learning about all those little nice little cross browser intricacies on the way.

As the saying goes nothing worthwhile in life comes easily and this seems to be particularly true with writing cross browser JavaScript code.