[b2g] user agent overrides not working correctly

RESOLVED FIXED in Firefox 28, Firefox OS v1.3

Status

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bkelly, Assigned: jchen)

Tracking

({regression})

unspecified
1.3 C3/1.4 S3(31jan)
ARM
Gonk (Firefox OS)
regression
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking-b2g:1.3+, firefox27 wontfix, firefox28 fixed, firefox29 fixed, b2g-v1.2 affected, b2g-v1.3 fixed, b2g-v1.4 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Recently I was trying to add a user agent override for a site in order to demonstrate to the developer that it would work on fxos.  It appears, though, that maybe the user agent overrides are not working correctly.

To see the problem:

1) Append the following in gecko's b2g/app/ua-updates.json.in:

    "whatsmyuseragent.com": "\\(Mobile#(Android; Mobile"

2) Flash gecko on the device.
3) Run make reset-gaia to force the immediate use of the ua-updates.json file.
4) Navigate to whatsmyuseragent.com in the device browser.

When I do this I see:

  Your user Agent String is:
  \(Mobile(Android; Mobile

It seems we're not actually applied a regex style substitution from this file like we did in v1.1.  Instead the contents of ua-updates.json entries simply replace the standard user agent.

Nom'ing for 1.3 since this seems like a serious problem.
(Reporter)

Updated

5 years ago
OS: Windows 8.1 → Gonk (Firefox OS)
Hardware: x86_64 → ARM
(Reporter)

Comment 1

5 years ago
Jim, do you have any idea what is going on here?
Blocks: 916205
Flags: needinfo?(nchen)
(Assignee)

Comment 2

5 years ago
Looks like regex replacement is not being done for updates from ua-update.json. Should be a simple fix.
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Flags: needinfo?(nchen)
(Reporter)

Comment 3

5 years ago
By the way, I saw this on a v1.2 keon as well.
status-b2g-v1.2: --- → affected
status-b2g-v1.3: --- → affected
(Assignee)

Comment 4

5 years ago
Created attachment 8366087 [details] [diff] [review]
Perform replacements for updated UA overrides (v1)

This patch moves override replacement to its own function and calls the function for each override in the updated overrides list. The patch also adds a test for partial overrides.
Attachment #8366087 - Flags: review?(fabrice)

Updated

5 years ago
blocking-b2g: 1.3? → 1.3+
Attachment #8366087 - Flags: review?(fabrice) → review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bcb7b4eed467
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.3 C3/1.4 S3(31jan)
https://hg.mozilla.org/releases/mozilla-aurora/rev/f607a137eb27
status-b2g-v1.3: affected → fixed
status-b2g-v1.4: --- → fixed
status-firefox27: --- → wontfix
status-firefox28: --- → fixed
status-firefox29: --- → fixed
You need to log in before you can comment on or make changes to this bug.