Open Bug 648444 Opened 14 years ago Updated 2 years ago

Mechanism for websites to get information like version, channel, etc. from the browser

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

People

(Reporter: kairo, Unassigned)

Details

For e.g. support websites, probably not only internal ones but also others, we will want some mechanism to fetch information about the browser like accurate version or channel, maybe other info as well. This should be a mechanism available to JS but outside the UA string (which can then be cut down more easily) and which need the user to opt into giving away the info, with possibly having a pre-created whitelist of some Mozilla sites like SUMO or AMO. The opt-in could be done in a similar fashion to what we do for Geolocation. I'm not 100% sure which component this belongs to in the end, but it's IMHO important to have it filed so we can start figuring out what to do here.
The API could be something like this: The page calls netscape.getSupportInfo(callback);. If the Origin of the caller is authorized to obtain support info, a task is queued on the event loop. (This is necessary to make sure the API is always async regardless of how authorization happens.) When the task fires, it calls |callback| with a single argument that is a JavaScript object along the lines of { "updateChannel" : "aurora", "preciseVersion": "6.0.443839", "gpuAcceleratedWindows": "0/2" } This would allow new key-value pairs to be added over time, would allow values for some keys to be arrays, etc. (I think a totally product-specific API doesn't belong on the window object and doesn't belong on navigator. For historical reasons, our vendor object is called netscape. I think reusing that object makes sense.)
On SUMO, we essentially are going to assume that users are up to date. That is if their user agent is Firefox 5.0, we assume aurora right now and beta after May 17th and release after June whenever. Having a precise version would be nice but I personally think that putting this info in about:support and the approach in the bug 554174 is the way to go.
That API is perfect for bug 554174. The best solution for SUMO would be to do both at once and include all the about:support information in this API.
Severity: normal → S3
Severity: S3 → --
Type: defect → enhancement
Component: General → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.