Make User Agent overrides affect navigator.userAgent in addition to the HTTP header

RESOLVED FIXED in Firefox 17

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: dao, Assigned: dao)

Tracking

Trunk
mozilla19
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox17 fixed, firefox18 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
Bug 795348 might need this unless that site can be evangelized. Either way, it will be good to have the ability to override navigator.userAgent up our sleeve.

I suppose UserAgentOverrides.jsm needs to converted to an XPCOM service, or an XPCOM services utilizing UserAgentOverrides.jsm needs to be added, such that Navigator.cpp can use that. Does this sound reasonable?

Comment 1

5 years ago
Seems fine to me, yes.
(Assignee)

Comment 2

5 years ago
Created attachment 670305 [details] [diff] [review]
patch
Assignee: nobody → dao
Status: NEW → ASSIGNED
Attachment #670305 - Flags: review?(bzbarsky)
(Assignee)

Comment 3

5 years ago
Created attachment 670306 [details] [diff] [review]
override for testing

You can test this on <https://direktnet.raiffeisen.hu/rai/direktnet/home.do>. With the override applied, the login form should be present.

Comment 4

5 years ago
Comment on attachment 670305 [details] [diff] [review]
patch

>+++ b/dom/base/Navigator.cpp
> Navigator::GetUserAgent(nsAString& aUserAgent)
>+  NS_ENSURE_SUCCESS(rv, NS_OK);

Second arg should be rv.

>+  nsCOMPtr<nsIDocument> doc = do_QueryInterface(win->GetExtantDocument());

  nsIDocument* doc = win->GetExtantDoc();

r=me with those.
Attachment #670305 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 5

5 years ago
Created attachment 670558 [details] [diff] [review]
patch, review comments addressed
Attachment #670305 - Attachment is obsolete: true
Attachment #670306 - Attachment is obsolete: true
(Assignee)

Comment 6

5 years ago
https://bugzilla.mozilla.org/attachment.cgi?id=670558
(Assignee)

Comment 7

5 years ago
(In reply to Dão Gottwald [:dao] from comment #6)
> https://bugzilla.mozilla.org/attachment.cgi?id=670558

wrong link...

https://hg.mozilla.org/integration/mozilla-inbound/rev/9f28c28e988f

Comment 8

5 years ago
https://hg.mozilla.org/mozilla-central/rev/9f28c28e988f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
(Assignee)

Comment 9

5 years ago
Comment on attachment 670558 [details] [diff] [review]
patch, review comments addressed

[Approval Request Comment]

Extends our ability to react to sites that are broken due to bad UA sniffing.

Bug caused by (feature/regressing bug #): n/a
User impact if declined: n/a
Testing completed (on m-c, etc.): on m-c
Risk to taking this patch (and alternatives if risky): low, I think
String or UUID changes made by this patch: none
Attachment #670558 - Flags: approval-mozilla-beta?
Attachment #670558 - Flags: approval-mozilla-aurora?
Attachment #670558 - Flags: approval-mozilla-beta?
Attachment #670558 - Flags: approval-mozilla-beta+
Attachment #670558 - Flags: approval-mozilla-aurora?
Attachment #670558 - Flags: approval-mozilla-aurora+
(Assignee)

Comment 10

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/717bd76378cc
https://hg.mozilla.org/releases/mozilla-beta/rev/3c067c8fb7fd
status-firefox17: --- → fixed
status-firefox18: --- → fixed
Blocks: 822551
Depends on: 814379
You need to log in before you can comment on or make changes to this bug.