Non-Flash Website Doesn't Work Without Flash Player Installed

Posted by Steve Green on 18 August 2011.

This is one of the more bizarre bugs we have found, and it had us puzzled for quite some time.

While conducting browser compatibility testing on a website, we found that the hide/reveal functionality was not working in Internet Explorer 7, 8 and 9 on some Windows Vista and Windows 7 machines. It worked in other browsers and it worked in those Internet Explorer versions on some other machines. It worked in all Internet Explorer versions on Windows XP on all machines. What on earth was going on?

We didn't want to pass the bug over to the developers just yet because we knew it would just get bounced back as "works for us". So we started investigating.

A JavaScript error

Internet Explorer's Developer Tools showed that a JavaScript error occurred in the machines where hide/reveal does not work, but the fault does not occur on the other machines even though they have the same Windows and Internet Explorer versions. Hmm, how can that happen?

'Dirty' environments work best!

By now we were testing on every machine we could get our hands on to see if a pattern emerged. It did, but not as we had expected. All the 'dirty' machines in the office worked correctly - it was the nice 'clean' test machines with their fresh installations of Windows that didn't. And all the Windows XP machines worked regardless of whether they were 'clean' or 'dirty'.

We needed to find what was different between the two groups of machines, and our first thought was Windows Update, but fully patching the test machines made no difference. Nor did installing Microsoft Office or any of the other applications that were present on the 'dirty' machines.

The unlikely culprit

Then we noticed than none of the 'clean' test machines had Flash Player installed - they didn't need to because the website does not use Flash. But all the 'dirty' machines did, as did all Windows XP machines (XP comes with Flash Player 6r79). Obviously the absence of Flash Player couldn't be causing the problem but we installed it anyway. And the hide/reveal functionality started to work!

The root cause

It turned out that the jQuery JavaScript library contained a Flash detection script that is not needed. If Flash Player was not installed, alternate content was being introduced that caused the JavaScript error that prevented the hide/reveal script from working.

The 'clean' machines did not work because unlike Windows XP, Windows Vista and Windows 7 do not come with Flash Player installed. Firefox has never come with Flash Player but Safari for Mac always has done and Google Chrome does now although it did not used to.

In conclusion

This highlights the importance of testing on clean environments, which the developers had clearly never done. It also shows how a bug that might have been reported as being intermittent, actually was 100% repeatable once the diagnostic process had identified the root cause.