[whatwg] Exposing UA information to workers

Jonas Sicking jonas at sicking.cc
Mon Nov 3 15:59:18 PST 2008


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



More information about the whatwg mailing list