From d931849dc32f43485cd9293f998dabf0034f10c4 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Wed, 13 Aug 2008 01:38:35 +0000 Subject: [PATCH] [] (0) Define a set of properties for browser detection. git-svn-id: http://svn.whatwg.org/webapps@2070 340c8d12-0b0e-0410-8428-c7bf67bfef74 --- index | 123 +++++++++++++++++++++++++++++++++++++++++++++++---------- source | 93 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 185 insertions(+), 31 deletions(-) diff --git a/index b/index index 3ed352686e1..bbf0cbdbf7d 100644 --- a/index +++ b/index @@ -1299,15 +1299,19 @@ Notifications -
  • 5.6 Browser state +
  • 5.6 System state and + capabilities @@ -1347,7 +1351,7 @@
  • 5.7.6 Application cache API -
  • 5.7.7 Browser +
  • 5.7.7 Browser state @@ -31922,7 +31926,7 @@ never reset. This is nice and consistent.) Window open(in DOMString url, in DOMString target, in DOMString features, in DOMString replace); // the user agent - readonly attribute ClientInformation navigator; + readonly attribute Navigator navigator; readonly attribute Storage localStorage; readonly attribute Storage sessionStorage; Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize); @@ -33737,25 +33741,102 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t brought to the user's attention, and the onclick callback should then be invoked. -

    5.6 Browser state

    +

    5.6 System state and capabilities

    The navigator attribute of the Window interface must - return an instance of the ClientInformation interface, which - represents the identity and state of the user agent (the client), and - allows Web pages to register themselves as potential protocol and content - handlers: - -

    interface ClientInformation {
    +   return an instance of the Navigator
    +   interface, which represents the identity and state of the user agent (the
    +   client), and allows Web pages to register themselves as potential protocol
    +   and content handlers:
    +
    +  
    interface Navigator {
    +  // client identification
    +  readonly attribute DOMString appName;
    +  readonly attribute DOMString appVersion;
    +  readonly attribute DOMString platform;
    +  readonly attribute DOMString userAgent;
    +
    +  // system state
       readonly attribute boolean onLine;
       void registerProtocolHandler(in DOMString protocol, in DOMString url, in DOMString title);
       void registerContentHandler(in DOMString mimeType, in DOMString url, in DOMString title);
    -};
    - +};
    + + + + +

    5.6.1 Client identification

    + +

    In certain cases, despite the best efforts of the entire industry, Web + browsers have bugs and limitations that Web authors are forced to work + around. + +

    This section defines a collection of attributes that can be used to + determine, from script, the kind of user agent in use, in order to work + around these issues. + +

    Client detection should always be limited to detecting known current + versions; future versions and unknown versions should always be assumed to + be fully compliant. + +

    + + +
    appName + +
    +

    Must return either the string "Netscape" or the + full name of the browser, e.g. "Mellblom + Browsernator". + +

    appVersion + +
    +

    Must return either the string "4.0" or a string + representing the version of the browser in detail, e.g. "1.0 (VMS; en-US) Mellblomenator/9000". +

    + + + +
    platform + +
    +

    Must return a string representing the platform on which the browser is + executing, e.g. "MacIntel", "Win32", "FreeBSD i386", "WebTV OS". +

    + + + + + +
    userAgent + +
    +

    Must return the string used for the value of the "User-Agent" header in HTTP requests. +

    + + +
    -

    5.6.1 Custom protocol and +

    5.6.2 Custom protocol and content handlers

    The 5.6.1.1. Security and privacy +

    5.6.2.1. Security and privacy

    These mechanisms can introduce a number of concerns, in particular privacy concerns. @@ -33980,7 +34061,7 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t trust the third-party handler, a decision many users are unable to make or even understand). -

    5.6.1.2. Sample user +
    5.6.2.2. Sample user interface

    This section is non-normative. @@ -35575,7 +35656,7 @@ style/default.css href="#applicationcache">ApplicationCache object. -

    5.7.7 Browser state

    +

    5.7.7 Browser state

    The navigator.onLine attribute diff --git a/source b/source index 30c67a1afb8..7fef5a661a7 100644 --- a/source +++ b/source @@ -29164,7 +29164,7 @@ never reset. This is nice and consistent.) Window open(in DOMString url, in DOMString target, in DOMString features, in DOMString replace); // the user agent - readonly attribute ClientInformation navigator; + readonly attribute Navigator navigator; readonly attribute Storage localStorage; readonly attribute Storage sessionStorage; Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize); @@ -31069,21 +31069,94 @@ JSURL: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t -

    Browser state

    +

    System state and capabilities

    The navigator attribute of the Window interface must return an - instance of the ClientInformation interface, which - represents the identity and state of the user agent (the client), - and allows Web pages to register themselves as potential protocol - and content handlers:

    - -
    interface ClientInformation {
    +  instance of the Navigator interface, which represents
    +  the identity and state of the user agent (the client), and allows
    +  Web pages to register themselves as potential protocol and content
    +  handlers:

    + +
    interface Navigator {
    +  // client identification
    +  readonly attribute DOMString appName;
    +  readonly attribute DOMString appVersion;
    +  readonly attribute DOMString platform;
    +  readonly attribute DOMString userAgent;
    +
    +  // system state
       readonly attribute boolean onLine;
       void registerProtocolHandler(in DOMString protocol, in DOMString url, in DOMString title);
       void registerContentHandler(in DOMString mimeType, in DOMString url, in DOMString title);
    -};
    - +};
    + + + + + + + +

    Client identification

    + +

    In certain cases, despite the best efforts of the entire + industry, Web browsers have bugs and limitations that Web authors + are forced to work around.

    + +

    This section defines a collection of attributes that can be used + to determine, from script, the kind of user agent in use, in order + to work around these issues.

    + +

    Client detection should always be limited to detecting known + current versions; future versions and unknown versions should always + be assumed to be fully compliant.

    + +
    + + + + + +
    appName
    +

    Must return either the string "Netscape" or the full name of the browser, e.g. "Mellblom Browsernator".

    + +
    appVersion
    +

    Must return either the string "4.0" or a string representing the version of the browser in detail, e.g. "1.0 (VMS; en-US) Mellblomenator/9000".

    + + + + + +
    platform
    +

    Must return a string representing the platform on which the browser is executing, e.g. "MacIntel", "Win32", "FreeBSD i386", "WebTV OS".

    + + + + + + + + + +
    userAgent
    +

    Must return the string used for the value of the "User-Agent" header in HTTP requests.

    + + + + + +
    +

    Custom protocol and content handlers