Open Bug 920172 Opened 12 years ago Updated 3 years ago

UA override should log an event in the console

Categories

(Core :: Networking, defect, P5)

x86
macOS
defect

Tracking

()

People

(Reporter: karlcow, Unassigned)

Details

(Whiteboard: [necko-would-take])

When a UA override is happening for a specific domain. A message should be sent to the console giving the following information: * The domain having an override * The user agent used * The bug number (* a link to https://wiki.mozilla.org/UA/override) The information is contained in https://hg.mozilla.org/mozilla-central/raw-file/tip/b2g/app/ua-update.json.in Example: // bug 826504, orkut.com.br "orkut.com.br": "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19", The log message could be: Warning: UA override for $domain with the $UAString. See $bugid about https://wiki.mozilla.org/UA/override (actual message can be improved, modified)
In case it was not clear, the message should appear in devtools console. It is mainly to help the Web developer to understand what is happening when testing the Web site. Given that UA override is not something which has been initiated by the developer him/herself.
Flags: needinfo?(jimb)
This sounds like a question for Mihai. I don't work with the web console much.
Flags: needinfo?(jimb) → needinfo?(mihai.sucan)
I am not sure what is the question. To display a message in the web console you need to use an nsIScriptError with the ID of the target window. Or call window.console.log().
Flags: needinfo?(mihai.sucan)
Mihai, thanks for the answer. Currently we have a UA override mechanism in place for Firefox OS. We need to make it obvious for Web developers when it is happening. Jim, do you know who we would should ping?
Flags: needinfo?(nchen)
(In reply to Karl Dubost :karlcow from comment #4) > Mihai, thanks for the answer. > > Currently we have a UA override mechanism in place for Firefox OS. We need > to make it obvious for Web developers when it is happening. > > Jim, do you know who we would should ping? I think either Dão or I can work on it. Note that it would be hard to include the bug number in the message, because the bug # is a comment in the file and it's stripped out when processing the file.
Flags: needinfo?(nchen)
(In reply to Jim Chen [:jchen :nchen] from comment #5) > I think either Dão or I can work on it. Note that it would be hard to > include the bug number in the message, because the bug # is a comment in the > file and it's stripped out when processing the file. Which part of the source code needs to be modified. URI?
Whiteboard: [necko-would-take]
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.