W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2008

[whatwg] Exposing UA information to workers

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 03 Nov 2008 15:59:18 -0800
Message-ID: <490F9056.7080806@sicking.cc>
For future compat it would be good to expose to workers information on 
what browser is currently being used. This can be used to work around 
bugs and lack of features.

In a 'normal' window context the navigator object exposes a set of 
properties, such as userAgent, that can be used for this purpose. I 
suggest we add something similar to the worker context. The HTML5 spec 
defines the following:

interface Navigator {
   // client identification
   readonly attribute DOMString appName;
   readonly attribute DOMString appVersion;
   readonly attribute DOMString platform;
   readonly attribute DOMString userAgent;

   // ... other things not related to identifying the UA
};

I'm not sure how stable this part of the HTML5 spec is, (I know firefox 
exposes a whole host of more properties), but it seems like a good set 
to start with. We should probably keep the two in sync if the window 
context Navigator object changes in the future.


Orthoginally, it seems like at least the 'onLine' boolean on the 
Navigator interface would be useful too, and could be exposed at the 
same place.

Let me know what you think.

/ Jonas
Received on Monday, 3 November 2008 15:59:18 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:07 UTC