Muffinresearch Labs by Stuart Colville

O2 thinks Camino is out of Date | Comments (0)

Posted in Browsers on 27th October 2006, 12:40 am by Stuart

O2 website with alert saying 'Your browser is out of date'

I was amused to find when I visited the O2.co.uk website with camino, an alert box popped up saying “Your browser is out of date. Would you like to upgrade it now for a better user experience? (Highly recommended)”.

Of course I clicked “ok” as I am always up for a better user experience. I was sent to this page: http://www.o2.co.uk/browserupgrade?check=Netscape which offered me a shiny new version of netscape to replace my outdated Camino. The icing on the cake being the message, “There’s no version of Netscape 8 for mac!”.

Here’s the code that prompted the upgrade; a choice piece of hard to maintain browser detection.

function browserUpgrade(){
	setCookie('alreadyVisitedOnce','yes');
	var NS, IE, aaa, OP, OP34, Moz, Pho, Saf, CW, PDA, LX;
	var NSVer, IEVer, OPVer, MozVer;

	Pho = navigator.vendor == "Phoenix";
	Moz = navigator.vendor == "Firefox";
	NS = (navigator.appName == "Netscape") && !(Pho) && !(Moz);
	IE = navigator.appVersion.indexOf("MSIE")!=-1;
	OP = navigator.userAgent.indexOf("Opera") > -1;
	Saf = navigator.userAgent.indexOf("Safari") > -1;
	CW = navigator.userAgent.indexOf("DigExt") > -1; //Is the browser a Carphone Warehouse?
	PDA = navigator.userAgent.indexOf("PPC") > -1; // Is the device a PDA?
	LX = navigator.platform.indexOf("Linux") > -1; //Is the OS platform Linux?
	// OD = navigator.userAgent == null; // OD = Old Devices

	if (NS) {
		if (navigator.vendorSub == null) {
		navvensub = navigator.appVersion;
		NSVer = navvensub.substr(navvensub.indexOf(" ").length, 1);
		NSVer = parseFloat(NSVer);
		} else {
		// using vendorSub object, as appVersion comes out as 5.0 (from Mozilla/5) also if it is NS 6 or NS 7 !!!
		navvensub = navigator.vendorSub;
		NSVer = navvensub.substr(navvensub.indexOf(".").length, 1);
		NSVer = parseFloat(NSVer);
			}
		}

	if (Moz) {
		//MozVer = parseFloat(navigator.vendorSub);
		/*this used to be fine previously. FireFox uses different ways to define the vendorSub dependin on the release.
		FireFox .93	  = 0.9.3
		FireFox 1.0PR = 0.1
		FireFox .93   = 1.0.3
		*/
		MozVer = navigator.vendorSub.split(".");
			if (MozVer[2] == null) {
			MozVer = MozVer[0]+MozVer[1];
			} else {
			MozVer = MozVer[0]+MozVer[1]+MozVer[2];
			}
		}

	else if (IE) {
		navag = navigator.userAgent;
		IEVer = navag.substr(navag.indexOf("MSIE ")+("MSIE ").length, 4);
		IEVer = parseFloat(IEVer); 

		if (OP) {
			OPVer = navag.substr(navag.indexOf("Opera ")+("Opera ").length, 4);
			OPVer = parseFloat(OPVer);
			}
		}

	//if ((NS) && !(Saf) && !(LX) && (NSVer < 7)) {
	if ((NS) && !(LX) && !(Saf) && (NSVer < 7)) {
			redir("Netscape");
	}

	if (Pho) {
		var redirectURL = "http://www.o2.co.uk/browserupgrade?check=Mozilla";
		if (document.images) window.location.replace(redirectURL); // if Netscape
		else window.location = redirectURL; // else if not Netscape
	}

	if (Moz) {// in case browser is Mozilla Firefox
			if (MozVer<103) { // and navigator.vendorSub is less than 1.0.3
			redir("Mozilla");
			}
	}

	else if ((IE) && !(CW) && !(PDA) && !(LX)) {
		if ((OP) && ( OPVer < 8 ) {
				redir("Opera");
		}
		else if(IEVer <= 5) {
				redir("IE");
			}
		}
}

Post Tools

Comments: Add yours







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.580s.