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>



Standalone mac battery charger|(0)

Got a spare mac battery? I’ve often wondered why up until now no-one’s produced a standalone charger so that you can charge batteries without having to plug them into the mac. Fortunately Fastmac.com have produced a standalone charger that allows you to do just that. and it’s compatible with iBooks, Powerbooks, macbooks and Macbook Pros. It’s also 110/200v. Exactly what I was looking for!

Django Admin Ominigraffle Stencil|(0)

Colleague Alex Lee has created a nice stencil for omingraffle with the Django Admin UI components, perfect for wireframing customised admin screens. For more details and to download the stencil see Alex’s Blog csensedesign.co.uk

Photos on Flickr

© Copyright 2004-08 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by 1&1 This page was baked in 0.725s.