Closed Bug 1008889 Opened 8 years ago Closed 8 years ago

state.gov sends desktop site to Firefox OS and Firefox on Android

Categories

(Web Compatibility :: Mobile, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hsteen, Assigned: adamopenweb)

References

()

Details

(Whiteboard: [country-us] [sitewait] [mentor=hsteen] [clientsniff])

Attachments

(1 file)

Attached image comparison screenshot
This site intends to send mobile browsers to a mobile site, but doesn't know that Firefox OS devices are smartphones. Hence the browser on Firefox OS phones get desktop content instead of mobile. So does the Firefox on Android browser and even the Android stock browser.

The JavaScript snippet below shows how the sniffing works:


http://www.state.gov/js/cookies.js


function CheckMobile(mobile_file){
	var agent = navigator.userAgent.toLowerCase();
	var regex = /iP(hone|od|ad)|blackberry|avantgo|blazer|compal|elaine|fennec|hiptop|iemobile|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|pixi|plucker|pocket|psp|smartphone|symbian|treo|vodafone|wap|windows (ce|phone)|xiino|nok(6|i)/i;
	if (typeof agent != "undefined" && agent.search(regex) != -1) {
		var urlParam = GetUrlParam("goMobile");
		if(urlParam) {
			WriteCookie("goMobile","0",12);
                }
		else {
			WriteCookie("testCookie","works",1);
			if(ReadCookie("testCookie")) {
				// cookies definitely work, so look at mobile cookie
				if(!ReadCookie("goMobile")) {
					//alert('mobile device.  no mobile cookie and cookies work. go to m.state.gov');
                			location.href="http://m.state.gov/"+mobile_file;
				}
			}
		}
        }
}
Good place to start:

Janice Clark - Director, Website Management for Office of Website Management
http://www.linkedin.com/pub/janice-clark/6/a1a/15

Trying twitter: https://twitter.com/AdamOpenWeb/status/472061078269353984
Assignee: nobody → astevenson
Status: NEW → ASSIGNED
Whiteboard: [country-us] [contactready] [mentor=hsteen] [clientsniff] → [country-us] [sitewait] [mentor=hsteen] [clientsniff]
Response: @AdamOpenWeb thanks. We're looking into it.
Response: "@AdamOpenWeb should be fixed. Let me know! Thx"

Tested on Firefox Android and FFOS, we get the mobile site now.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.