[html5] r3124 - [e] (0) registerContentHandler() clarifications.

whatwg at whatwg.org whatwg at whatwg.org
Sun May 24 19:34:58 PDT 2009


Author: ianh
Date: 2009-05-24 19:34:56 -0700 (Sun, 24 May 2009)
New Revision: 3124

Modified:
   index
   source
Log:
[e] (0) registerContentHandler() clarifications.

Modified: index
===================================================================
--- index	2009-05-25 01:27:02 UTC (rev 3123)
+++ index	2009-05-25 02:34:56 UTC (rev 3124)
@@ -48944,8 +48944,9 @@
   interface. UAs could also simply silently collect the information,
   providing it only when relevant to the user.</p>
 
-  <p>There is <a href=#sample-handler-impl>an example of how these
-  methods could be presented to the user</a> below.</p>
+  <p>User agents should keep track of which sites have registered
+  handlers (even if the user has declined such registrations) so that
+  the user is not repeatedly prompted with the same request.</p>
 
   <p>The arguments to the methods have the following meanings and
   corresponding implementation requirements:</p>
@@ -48964,6 +48965,9 @@
     (as in "<code>ftp:</code>"), will never match anything, since
     schemes don't contain colons.</p>
 
+    <p class=note>This feature is not intended to be used with
+    non-standard protocols.</p>
+
    </dd>
 
    <dt><var title="">mimeType</var> (<code title=dom-navigator-registerContentHandler><a href=#dom-navigator-registercontenthandler>registerContentHandler()</a></code> only)</dt>
@@ -48983,6 +48987,10 @@
     whitespace, or include MIME parameters, then the handler being
     registered will never be used.</p>
 
+    <p class=note>The type is compared to the MIME type used by the
+    user agent <em>after</em> the sniffing algorithms have been
+    applied.</p>
+
    </dd>
 
 
@@ -49173,14 +49181,17 @@
   <p>The <code title=dom-navigator-registerProtocolHandler><a href=#dom-navigator-registerprotocolhandler>registerProtocolHandler()</a></code>
   method could display a modal dialog box:</p>
 
-  <pre>||[ Protocol Handler Registration ]|||||||||||||||||||||||||||
+  <pre>||[ Content Handler Registration ]||||||||||||||||||||||||||||
 |                                                            |
 | This Web page:                                             |
 |                                                            |
 |    Kittens at work                                         |
 |    http://kittens.example.org/                             |
 |                                                            |
-| ...would like permission to handle the protocol "x-meow:"  |
+| ...would like permission to handle files of type:          |
+|                                                            |
+|    application/x-meowmeow                                  |
+|                                                            |
 | using the following Web-based application:                 |
 |                                                            |
 |    Kittens-at-work displayer                               |
@@ -49194,8 +49205,8 @@
 
   <p>...where "Kittens at work" is the title of the page that invoked
   the method, "http://kittens.example.org/" is the URL of that page,
-  "x-meow" is the string that was passed to the <code title=dom-navigator-registerProtocolHandler><a href=#dom-navigator-registerprotocolhandler>registerProtocolHandler()</a></code>
-  method as its first argument (<var title="">protocol</var>),
+  "application/x-meowmeow" is the string that was passed to the <code title=dom-navigator-registerContentHandler><a href=#dom-navigator-registercontenthandler>registerContentHandler()</a></code>
+  method as its first argument (<var title="">mimeType</var>),
   "http://kittens.example.org/?show=%s" was the second argument (<var title="">url</var>), and "Kittens-at-work displayer" was the third
   argument (<var title="">title</var>).</p>
 
@@ -49204,13 +49215,15 @@
   remembered.</p>
 
   <p>When the user then attempts to fetch a URL that uses the
-  "x-meow:" scheme, then it might display a dialog as follows:</p>
+  "application/x-meowmeow" MIME type, then it might display a dialog
+  as follows:</p>
 
-  <pre>||[ Unknown Protocol ]||||||||||||||||||||||||||||||||||||||||
+  <pre>||[ Unknown File Type ]|||||||||||||||||||||||||||||||||||||||
 |                                                            |
 | You have attempted to access:                              |
 |                                                            |
-|    x-meow:S2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%3D               |
+|    data:application/x-meowmeow;base64,S2l0dGVucyBhcmUgd    |
+|    GhlIGN1dGVzdCE%3D                                       |
 |                                                            |
 | How would you like FerretBrowser to handle this resource?  |
 |                                                            |
@@ -49223,8 +49236,8 @@
 |  ( ) Pass this URL to the "Kittens-at-work displayer"      |
 |      application at "kittens.example.org".                 |
 |                                                            |
-|  [ ] Always do this for resources using the "x-meow"       |
-|      protocol in future.                                   |
+|  [ ] Always do this for resources using the "application/  |
+|      x-meowmeow" protocol in future.                       |
 |                                                            |
 |                                     ( Ok )  (( Cancel ))   |
 |____________________________________________________________|</pre>
@@ -49235,11 +49248,11 @@
   <p>If the user does select that option, then the browser, in
   accordance with the requirements described in the previous two
   sections, will redirect the user to
-  "http://kittens.example.org/?show=x-meow%3AS2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%253D".</p>
+  "http://kittens.example.org/?show=data%3Aapplication/x-meowmeow;base64,S2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%253D".</p>
 
-  <p>The <code title=dom-navigator-registerContentHandler><a href=#dom-navigator-registercontenthandler>registerContentHandler()</a></code>
-  method would work equivalently, but for unknown MIME types instead
-  of unknown protocols.</p>
+  <p>The <code title=dom-navigator-registerProtocolHandler><a href=#dom-navigator-registerprotocolhandler>registerProtocolHandler()</a></code>
+  method would work equivalently, but for schemes instead of unknown
+  content types.</p>
 
   </div>
 

Modified: source
===================================================================
--- source	2009-05-25 01:27:02 UTC (rev 3123)
+++ source	2009-05-25 02:34:56 UTC (rev 3124)
@@ -55827,8 +55827,9 @@
   interface. UAs could also simply silently collect the information,
   providing it only when relevant to the user.</p>
 
-  <p>There is <a href="#sample-handler-impl">an example of how these
-  methods could be presented to the user</a> below.</p>
+  <p>User agents should keep track of which sites have registered
+  handlers (even if the user has declined such registrations) so that
+  the user is not repeatedly prompted with the same request.</p>
 
   <p>The arguments to the methods have the following meanings and
   corresponding implementation requirements:</p>
@@ -55849,6 +55850,9 @@
     (as in "<code>ftp:</code>"), will never match anything, since
     schemes don't contain colons.</p>
 
+    <p class="note">This feature is not intended to be used with
+    non-standard protocols.</p>
+
    </dd>
 
    <dt><var title="">mimeType</var> (<code title="dom-navigator-registerContentHandler">registerContentHandler()</code> only)</dt>
@@ -55868,6 +55872,10 @@
     whitespace, or include MIME parameters, then the handler being
     registered will never be used.</p>
 
+    <p class="note">The type is compared to the MIME type used by the
+    user agent <em>after</em> the sniffing algorithms have been
+    applied.</p>
+
    </dd>
 
 
@@ -56078,14 +56086,17 @@
   title="dom-navigator-registerProtocolHandler">registerProtocolHandler()</code>
   method could display a modal dialog box:</p>
 
-  <pre>||[ Protocol Handler Registration ]|||||||||||||||||||||||||||
+  <pre>||[ Content Handler Registration ]||||||||||||||||||||||||||||
 |                                                            |
 | This Web page:                                             |
 |                                                            |
 |    Kittens at work                                         |
 |    http://kittens.example.org/                             |
 |                                                            |
-| ...would like permission to handle the protocol "x-meow:"  |
+| ...would like permission to handle files of type:          |
+|                                                            |
+|    application/x-meowmeow                                  |
+|                                                            |
 | using the following Web-based application:                 |
 |                                                            |
 |    Kittens-at-work displayer                               |
@@ -56099,9 +56110,9 @@
 
   <p>...where "Kittens at work" is the title of the page that invoked
   the method, "http://kittens.example.org/" is the URL of that page,
-  "x-meow" is the string that was passed to the <code
-  title="dom-navigator-registerProtocolHandler">registerProtocolHandler()</code>
-  method as its first argument (<var title="">protocol</var>),
+  "application/x-meowmeow" is the string that was passed to the <code
+  title="dom-navigator-registerContentHandler">registerContentHandler()</code>
+  method as its first argument (<var title="">mimeType</var>),
   "http://kittens.example.org/?show=%s" was the second argument (<var
   title="">url</var>), and "Kittens-at-work displayer" was the third
   argument (<var title="">title</var>).</p>
@@ -56111,13 +56122,15 @@
   remembered.</p>
 
   <p>When the user then attempts to fetch a URL that uses the
-  "x-meow:" scheme, then it might display a dialog as follows:</p>
+  "application/x-meowmeow" MIME type, then it might display a dialog
+  as follows:</p>
 
-  <pre>||[ Unknown Protocol ]||||||||||||||||||||||||||||||||||||||||
+  <pre>||[ Unknown File Type ]|||||||||||||||||||||||||||||||||||||||
 |                                                            |
 | You have attempted to access:                              |
 |                                                            |
-|    x-meow:S2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%3D               |
+|    data:application/x-meowmeow;base64,S2l0dGVucyBhcmUgd    |
+|    GhlIGN1dGVzdCE%3D                                       |
 |                                                            |
 | How would you like FerretBrowser to handle this resource?  |
 |                                                            |
@@ -56130,8 +56143,8 @@
 |  ( ) Pass this URL to the "Kittens-at-work displayer"      |
 |      application at "kittens.example.org".                 |
 |                                                            |
-|  [ ] Always do this for resources using the "x-meow"       |
-|      protocol in future.                                   |
+|  [ ] Always do this for resources using the "application/  |
+|      x-meowmeow" protocol in future.                       |
 |                                                            |
 |                                     ( Ok )  (( Cancel ))   |
 |____________________________________________________________|</pre>
@@ -56142,12 +56155,12 @@
   <p>If the user does select that option, then the browser, in
   accordance with the requirements described in the previous two
   sections, will redirect the user to
-  "http://kittens.example.org/?show=x-meow%3AS2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%253D".</p>
+  "http://kittens.example.org/?show=data%3Aapplication/x-meowmeow;base64,S2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%253D".</p>
 
   <p>The <code
-  title="dom-navigator-registerContentHandler">registerContentHandler()</code>
-  method would work equivalently, but for unknown MIME types instead
-  of unknown protocols.</p>
+  title="dom-navigator-registerProtocolHandler">registerProtocolHandler()</code>
+  method would work equivalently, but for schemes instead of unknown
+  content types.</p>
 
   </div>
 




More information about the Commit-Watchers mailing list