Closed
Bug 1008889
Opened 11 years ago
Closed 11 years ago
state.gov sends desktop site to Firefox OS and Firefox on Android
Categories
(Web Compatibility :: Site Reports, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: hsteen, Assigned: adamopenweb)
References
()
Details
(Whiteboard: [country-us] [sitewait] [mentor=hsteen] [clientsniff])
Attachments
(1 file)
|
433.51 KB,
image/png
|
Details |
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;
}
}
}
}
}
| Assignee | ||
Comment 1•11 years ago
|
||
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]
| Assignee | ||
Comment 2•11 years ago
|
||
Response: @AdamOpenWeb thanks. We're looking into it.
| Assignee | ||
Comment 3•11 years ago
|
||
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: 11 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Tech Evangelism → Web Compatibility
Updated•2 years ago
|
Component: Mobile → Site Reports
You need to log in
before you can comment on or make changes to this bug.
Description
•