venerdì, ottobre 09, 2009

Flash and 64-Bit Browsers - Redux

Flash, and other 32-bit Add Ons (such as Silverlight) will not run in a 64-bit version of Internet Explorer. As outlined in a Tech Note, Adobe is still working on creating a version of Flash that will play in a 64-bit browser. (Currently Linux is the only version being tested.)

“Adobe Flash Player is not supported for playback in a 64-bit browser. However, you can run Flash Player in a 32-bit browser running on a 64-bit operating system.”

Since 64-bit operating systems are becoming more mainstream, I thought I’d research the three main browsers. In a nutshell, IE is the browser that will most often not be able to support Flash content.

Firefox 64-Bit

This seems to be a non-issue at the moment as Firefox does not seem to have an officially released 64-bit version of the browser. A knowledgebase article says the following: “Firefox will work on 64-bit versions of Windows, but it is not a 64 bit application.”

However, according to this thread there are third-party 64-bit builds available from http://www.vector64.com/WindowsBuilds.html. However, it seems like only a small subset of users that would seek that out.

Safari 64-Bit

According to a great article Sean located, it seems that Flash is able to run even when Safari runs in 64-bit mode.

“…when Safari runs in 64-bit mode, plugins actually run as their own separate processes rather than being bundled up with Safari. But when Safari is run in 32-bit mode, Flash and other plugins work the old way, which means if (when) Flash crashes, so will Safari.”

You also have the option of setting Safari to start up in 32-bit mode:

Safari > Get Info. In the resulting dialog box, select the checkbox that says "Open in 32-bit mode."

Note: Should we decide that we need to detect for 64-bit mode after all, this code seems like it could be a good starting place.

if (navigator.appVersion.indexOf("Safari") != -1

&& navigator.appVersion.indexOf("Mac OS X 10_6") != -1 {

document.write('<br>You are running Safari in 64-bit mode. ')

}

IE 7 and 8 – 64-Bit

I found this page a helpful starting point to approaching this issue. Specifically the section quoted below. Even though browser sniffing is not a perfect solution, it still might help to direct users to more user friendly error pages.

Detecting 64-bit Internet Explorer

As machines with more than 4 gigabytes of RAM become more common, more and more users are running 64-bit versions of Windows. For compatibility with 3rd party add-ons, the 32-bit edition of Internet Explorer remains the default on 64-bit systems. However, in some cases it can be useful for websites to recognize when users are visiting using 64-bit systems—for instance, a site may want to know whether to offer a 64-bit executable download.

Tokens in the User-Agent string will enable you to determine whether or not the user is running a 64-bit version of Windows, and whether they are running the 64-bit edition of Internet Explorer.

64-bit IE on 64-bit Windows:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0)

32-bit IE on 64-bit Windows:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0)

A simple bit of JavaScript that seems to successfully detect whether a user is utilizing IE 64-bit:

<script type="text/javascript">

var myUserAgent = navigator.userAgent;

var myCPUType = navigator.cpuClass;

var myOperatingSystem = navigator.platform;

var is64BitIEon64BitWindows = /Win64/gi; // 64-bit IE on 64-bit Windows

var is32BitIEon64BitWindows =  /WOW64/gi; // 32-bit IE on 64-bit Windows

var browserCanPlayAddOns = "True - 64-bit not detected";

if (myUserAgent.match(is64BitIEon64BitWindows)) {

       browserCanPlayAddOns = "False - 64-bit browser";

}

if (myUserAgent.match(is32BitIEon64BitWindows)) {

       browserCanPlayAddOns = "True - 32-bit browser on 64-bit os";

}

document.write(browserCanPlayAddOns)

</script>