Closed
Bug 960851
Opened 12 years ago
Closed 7 years ago
www.sponichi.co.jp shows "view mobile site" banner in other mobile browsers, not in Firefox OS
Categories
(Web Compatibility :: Site Reports, defect, P5)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: hsteen, Unassigned, Mentored)
References
()
Details
(Whiteboard: [clientsniff] [country-jp] [contactready] )
Attachments
(1 file)
225.00 KB,
image/png
|
Details |
http://www.sponichi.co.jp/js/common/common.js will either redirect or show banner depending on the browser sniffing and where you are on the site:
// smartphone
if (navigator.userAgent.search(/iphone/i) > -1
|| navigator.userAgent.search(/android/i) > -1
|| navigator.userAgent.search(/windows phone/i) > -1) {
var path = window.location.pathname;
var redirect = false;
if (path == '/' || path == '/index.html') {
redirect = true;
}
if (path.match(/^\/(soccer|baseball|battle|sports|olympic|entertainment|society|gamble)\/($|index\.html$)/)) {
redirect = true;
}
if (path.match(/^\/(soccer|baseball|battle|sports|olympic|entertainment|society|gamble)\/news\/\d+\/\d+\/\d+\/kiji\/\w+\.html$/)) {
redirect = true;
}
if (redirect == true) {
sp_mode = getCookie("sp_mode");
if (sp_mode == 1) {
// SPモードに飛ばす
location.replace("http://m.sponichi.co.jp"+window.location.pathname);
} else {
// リンク生成
makeSPLink();
}
}
}
![]() |
||
Comment 1•11 years ago
|
||
suggestedfix |
According to the redirection script:
# iPhone (or more exactly iOS)
Currently there are 3 device types, if we remove the information which is not device related, we get:
_ (iPhone; _ iOS _) _ Mobile_
_ (iPod; _ iOS _) _ Mobile_
_ (iPad; _ iOS _) _ Mobile_
Mobile is a better string to use in this case, the site would catch ipad and ipod, which it doesn't now.
# Android
This is very generic and will almost anything, even tablet with the Android keywords.
# Windows Phone
The pattern for Windows Phone is:
_ (_ Windows Phone OS _ IEMobile_)
so the Web site script can be improved by doing:
// smartphone
if (navigator.userAgent.search(/mobi/i) > -1
|| navigator.userAgent.search(/android/i) > -1 {
var path = window.location.pathname;
// rest of the code
}
![]() |
||
Comment 2•11 years ago
|
||
The Web site belongs to "SPORTS NIPPON NEWSPAPERS."
They can be contacted through http://www.sponichi.co.jp/common/inquire/index.html
Whiteboard: [clientsniff] [country-jp] [contactready] → [clientsniff] [country-jp] [contactready] [mentor=kdubost]
Updated•11 years ago
|
Mentor: kdubost
Whiteboard: [clientsniff] [country-jp] [contactready] [mentor=kdubost] → [clientsniff] [country-jp] [contactready]
![]() |
||
Updated•9 years ago
|
Priority: -- → P5
Comment 3•7 years ago
|
||
Closing as we are not working on Firefox OS anymore.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Assignee | ||
Updated•6 years ago
|
Product: Tech Evangelism → Web Compatibility
Assignee | ||
Updated•1 year ago
|
Component: Mobile → Site Reports
You need to log in
before you can comment on or make changes to this bug.
Description
•