hao123.com doesn't recognize B2G UA as mobile

RESOLVED INVALID

Status

RESOLVED INVALID
6 years ago
3 years ago

People

(Reporter: lmandel, Assigned: karlcow)

Tracking

unspecified
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(b2g-v2.0 affected, b2g-v2.1 affected, b2g-v2.2 affected, b2g-master unaffected)

Details

(Whiteboard: [uaoverride] [country-cn][serversniff] [sitewait], URL)

Attachments

(4 attachments)

hao123.com serves a desktop site to B2G. Bug 819210 added an UA override for this domain. The override should be removed once the domain serves mobile content to B2G. This bug tracks the evangelism for the site to recognize the B2G UA and the removal of the override at that time.
Blocks: 827561
Whiteboard: [uaoverride]
(Assignee)

Updated

5 years ago
Whiteboard: [uaoverride] → [uaoverride] [country-zh]
Whiteboard: [uaoverride] [country-zh] → [uaoverride] [country-zh][serversniff]
(Assignee)

Updated

5 years ago
Duplicate of this bug: 907059
(Assignee)

Comment 2

5 years ago
description
hao123.com does a redirection for Android devices and not for Firefox OS. We currently have a UA override, that we need to remove. The site needs to be contacted.


Using Firefox for Android UA.

GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: www.hao123.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

HTTP/1.1 302 Found
Content-Length: 0
Date: Thu, 05 Sep 2013 11:59:53 GMT
Location: http://www.hao123.com/wise_test.php
Server: BWS/1.0

Then 

GET /wise_test.php HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: www.hao123.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

HTTP/1.1 302 Found
Content-Length: 0
Content-type: text/html
Date: Thu, 05 Sep 2013 12:00:54 GMT
Location: http://m.hao123.com/?vit=h123&from=3w123
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Server: BWS/1.0
Set-Cookie: BAIDUID=55DAFC3B8C3CD7A1F98F300E338BE0D9:FG=1; max-age=31536000; expires=Fri, 05-Sep-14 12:00:54 GMT; domain=.hao123.com; path=/; version=1

And 

GET /?vit=h123&from=3w123 HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: m.hao123.com
User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

HTTP/1.1 200 OK
Content-Encoding: gzip
Content-type: text/html;charset=utf-8
Date: Thu, 05 Sep 2013 12:01:27 GMT
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Server: BWS/1.0
Set-Cookie: BAIDUID=BEAC1AD45D37A2B78596ABABB743F370:FG=1; max-age=31536000; expires=Fri, 05-Sep-14 12:01:27 GMT; domain=.hao123.com; path=/; version=1
Transfer-Encoding: chunked
Vary: Accept-Encoding
author: c57ac1d37ff8e865aa5518c5d74273a9

With Firefox OS UA.

GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: www.hao123.com
User-Agent: Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: max-age=0
Content-Encoding: gzip
Content-Length: 36841
Content-type: text/html;charset=UTF-8
Date: Thu, 05 Sep 2013 12:02:05 GMT
ETag: "1609482341"
Expires: Thu, 05 Sep 2013 12:02:05 GMT
Last-Modified: Thu, 05 Sep 2013 11:18:00 GMT
P3P: CP=" OTI DSP COR IVA OUR IND COM "
Server: BWS/1.0
Set-Cookie: BAIDUID=476E5118FFB69B813F50A5646ADBBEDB:FG=1; max-age=31536000; expires=Fri, 05-Sep-14 12:02:05 GMT; domain=.hao123.com; path=/; version=1
Set-Cookie: hz=0; path=/; domain=www.hao123.com
Vary: Accept-Encoding
Flags: needinfo?(lecky.wanglei)
Whiteboard: [uaoverride] [country-zh][serversniff] → [uaoverride] [country-zh][serversniff] [contactready]

Updated

5 years ago
Flags: needinfo?(lecky.wanglei)

Comment 3

5 years ago
hi,karl,do you mean that i should contact the website?

Comment 4

5 years ago
hi,karl,do you mean that i should contact the website?
(Assignee)

Comment 5

5 years ago
Lecky, yes if you could, that would be nice. My chinese is rusty. :)
(Assignee)

Updated

5 years ago
Whiteboard: [uaoverride] [country-zh][serversniff] [contactready] → [uaoverride] [country-cn][serversniff] [contactready]
(Assignee)

Comment 6

5 years ago
Hao123 belongs to baidu.
http://www.hao123.com/abouthao123.htm
Assignee: nobody → kdubost
Status: NEW → ASSIGNED
(Assignee)

Comment 7

5 years ago
contactemail
Contacted someone working at baidu.
Whiteboard: [uaoverride] [country-cn][serversniff] [contactready] → [uaoverride] [country-cn][serversniff] [sitewait]
(Assignee)

Comment 8

4 years ago
no answer. Trying to recontact the same person.
(Assignee)

Comment 9

4 years ago
Ah.
550 5.1.1
   Error: the percentage of invalid recipients is over thresholds from
   63.245.216.72 (in reply to DATA command)

Bummer. The person doesn't work there anymore. We will have to try to find someone else.

Yliu, do you have contacts at Baidu?
Flags: needinfo?(yliu)

Comment 10

4 years ago
(In reply to Karl Dubost :karlcow from comment #9)
> Ah.
> 550 5.1.1
>    Error: the percentage of invalid recipients is over thresholds from
>    63.245.216.72 (in reply to DATA command)
> 
> Bummer. The person doesn't work there anymore. We will have to try to find
> someone else.
> 
> Yliu, do you have contacts at Baidu?

Hi Karl,

Our BD colleague Sam has contacnted Baidu, but not got their reply so far.

Updated

4 years ago
Flags: needinfo?(yliu)
(Assignee)

Updated

4 years ago
Depends on: 1094555
(Assignee)

Comment 11

4 years ago
yliu, 
See also what I have done for fixing the CSS on hao123.com in bug 1094555
just 6 lines of code. I have given the patche in the attachments, if it helps them to move faster on the issue.
Flags: needinfo?(yliu)

Comment 12

4 years ago
(In reply to Karl Dubost :karlcow from comment #11)
> yliu, 
> See also what I have done for fixing the CSS on hao123.com in bug 1094555
> just 6 lines of code. I have given the patche in the attachments, if it
> helps them to move faster on the issue.

Thanks Karl.
I will give the patch to hao123.com, hope they can fix these bugs as soon as possible.

Updated

4 years ago
Flags: needinfo?(yliu)
Created attachment 8563626 [details]
screenshot

Screenshot from Flame device
This seems fixed - except CSS issues still remain - but I'm wondering if the Flame has some site-specific spoofs although I've tried to disable them. Several "fixes" I can't reproduce in other environments :-/
Status: ASSIGNED → NEW
That screenshot was actually taken with the Android spoof setting intact - I thought I had disabled it..
Status: NEW → ASSIGNED
(Assignee)

Comment 16

4 years ago
the screenshot is not good. we still receive the desktop site.
Hi All,

   I can repro this bug on Flame v2.0&2.1&2.2,but can't repro on Flame v3.0.


See attachments: hao123_v2.2.png and logcat_v2.2_1243.txt
Reproduce rate: 5/5

Repro STR:
1.Connect a wifi and launch Browser app.
2.Go to URL "www.hao123.com".
3.Input some words in search box and search it.
**Some words and icons are overlapped and in a mess in URL "www.hao123.com". 

Flame 2.0 (affected):
Build ID               20150319000203
Gaia Revision          896803174633fc6acd3fd105f81c349b8e9b9633
Gaia Date              2015-03-10 06:32:26
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/rev/3db01d6d6df5
Gecko Version          32.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150319.033109
Firmware Date          Thu Mar 19 03:31:20 EDT 2015
Bootloader             L1TC000118D0

Flame 2.1 (affected):
Build ID               20150319001227
Gaia Revision          13c85d57f49b4bfd657ff674f2b530c141c94803
Gaia Date              2015-03-17 13:31:54
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/cd8d3214bffd
Gecko Version          34.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150319.034825
Firmware Date          Thu Mar 19 03:48:36 EDT 2015
Bootloader             L1TC000118D0

Flame 2.2 (affected):
Build ID               20150319002500
Gaia Revision          9043c11f699c15bb6072422d1dad6518d1b5ddda
Gaia Date              2015-03-19 01:40:44
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/c0442d170bec
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150319.042028
Firmware Date          Thu Mar 19 04:20:38 EDT 2015
Bootloader             L1TC000118D0

Flame 3.0 (unaffected):
Build ID               20150319160212
Gaia Revision          c39e15f631de80c69467fda0d4ea0bcda9e194ca
Gaia Date              2015-03-18 19:30:04
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/cbd0efcd976c
Gecko Version          39.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150319.193329
Firmware Date          Thu Mar 19 19:33:42 EDT 2015
Bootloader             L1TC000118D0
status-b2g-v2.0: --- → affected
status-b2g-v2.1: --- → affected
status-b2g-v2.2: --- → affected
status-b2g-master: --- → unaffected
Created attachment 8580583 [details]
logcat_v2.2_1243.txt
(Assignee)

Comment 20

4 years ago
Shally,
Did you deactivate remote User Agent override on both devices before testing?
Thanks?
Flags: needinfo?(lixia)
QA Whiteboard: [MGSEI-Triage+]
Flags: needinfo?(lixia)
(In reply to Karl Dubost :karlcow from comment #20)
> Shally,
> Did you deactivate remote User Agent override on both devices before testing?
> Thanks?

Hi Karl,

    I can't deactivate remote UA override,and it shows "User-Agent  Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0  Firefox/37.0" on Flame v2.2.
    If it is needed, could you help to provide the ways to deactivate?

Thank you very much.
Flags: needinfo?(kdubost)
(Assignee)

Comment 22

4 years ago
Shally,

Each time you need to test, it's necessary to deactivate the UA override on Firefox OS. 
The UA override is a mechanism to change dynamically the UA for specific domain names, not all domain names.


For deactivating the UA override, you need to set 
in /system/b2g/defaults/pref/user.js

  pref("general.useragent.updates.enabled", false); 


Do not hesitate to ask if you need more information.
Flags: needinfo?(kdubost)
Hi Karl,

    No such the matched strings: "general.useragent.updates.enabled" in "user.js" on Flame.

Thank you for your kindly reply.
(Assignee)

Comment 24

4 years ago
There is a mechanism for it
https://hg.mozilla.org/mozilla-central/file/tip/b2g/app/b2g.js#l913

Ok let's see. Download this bash script.
https://raw.githubusercontent.com/karlcow/webcompat/master/moz/mozua2.sh

Then in the shell, type:
bash mozua2.sh override off

You will get this message below more or less. The device will restart and UA override will be off.
After that you can test again hao123.com. Hope it helps.

=========================================
UA override management on Firefox OS 1.2+
=========================================
1518 KB/s (3726 bytes in 0.002s)
Stop UA override
Pushing to device
+ adb shell mount -o rw,remount /system
+ adb push /tmp/user.js.tmp /system/b2g/defaults/pref/user.js
936 KB/s (3776 bytes in 0.003s)
+ adb shell mount -o ro,remount /system
+ restart
+ echo 'Restart the device (software)'
Restart the device (software)
+ adb shell stop b2g
+ adb shell start b2g
+ echo 'Bye!'
Bye!



Tell me if you are successful.
Flags: needinfo?(lixia)
Hi Karl,

  Yes,it runs successfully.The url "http://www.hao123.com/" will display normally,upload the screenshot about on Flame v2.2.

Thank you very much.
Flags: needinfo?(lixia) → needinfo?(kdubost)
(Assignee)

Comment 27

4 years ago
excellent. Back to normal testing. :) Thanks Shally.
Flags: needinfo?(kdubost)
(Assignee)

Comment 28

3 years ago
We need to remove the UA override for this domain. 
When entering hao123.com on Chrome, Firefox OS or Firefox Android, we always receive the desktop version.
(Assignee)

Updated

3 years ago
Blocks: 1180543
(Assignee)

Updated

3 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.