[whatwg] Proposed additions to ClientInformation interface

Brady Eidson beidson at apple.com
Fri Jun 27 14:04:45 PDT 2008


One focus area for HTML5 has been to solidify the concept of "Web  
pages as Web Applications" and to introduce concepts to flesh out this  
new Web Application concept such as the application name, more  
flexible icons, offline data storage, and online/offline discovery.

There is one aspect to this notion of "Web Applications" that is being  
explored by multiple vendors but hasn't been explicitly addressed in  
HTML5 quite yet:  the "stand alone web application."
For the few among you unfamiliar with this idea, the concept is  
running a web application in a dedicated user agent that doesn't have  
the typical chrome, behavior, features, or footprint of a traditional  
browser.

In support of this new area of interest, I propose two new additions  
to the ClientInformation interface as follows:

First:  "readonly attribute boolean standalone;"

This is in the same vein as the window.navigator.onLine property which  
gives authors a great hint on how to change the behavior of their web  
application based on the existence of a network connection.  The  
standalone property would give web application developers a powerful  
hint as to whether or not they are running in a full browser or in a  
more minimalistic, dedicated user agent.  There's a number of things  
they might customize based on this situation such as look, feel, and  
available feature set.

I'd like us to try and avoid the user agent sniffing nightmare that is  
common on the web.  Currently a web application developer has to  
inspect the user agent and other nonstandard window.navigator  
properties to try to guess whether they're running in a full browser  
or a minimalistic interface.  Since this set of properties and user  
agents will keep changing over time, I think it's a prudent move to  
give scripts this simple flag as a future-proof way to make these  
powerful decisions.

Second:  "void makeStandalone();"

Web applications that have been fully designed to behave as stand  
alone applications should be able to announce this fact.   Currently  
web applications would have to state in their page that they are  
"standalone aware" and to instruct users on how they might go about  
creating a standalone version of the page.  I've seen and heard buzz  
that web authors would like a better way.

This is what the makeStandalone() call is about.  The intention behind  
the call is that the user agent would prompt the user about creating a  
standalone application from the current page.  Of course user agents  
would have full flexibility in how they respond to the call such as  
choosing to do nothing, prompting only once for a given domain or URL,  
or prompting only when the user prefers to be prompted.   I imagine  
most user agents would tie the workings of this method to a user  
action, much like popup blocking works currently, so the page could  
only enact the prompt when the user clicks on some control.  I just  
think it's quite valuable to get the tool out there for web  
applications to use.

The exact naming of this method call is up for debate, but I think my  
point is clear.

With my proposals, the ClientInformation interface would look as  
follows:

interface ClientInformation {
   readonly attribute boolean onLine;
   readonly attribute boolean standalone;
   void makeStandalone();
   void registerProtocolHandler(in DOMString protocol, in DOMString  
url, in DOMString title);
   void registerContentHandler(in DOMString mimeType, in DOMString  
url, in DOMString title);
};

Your thoughts?

~Brady Eidson



More information about the whatwg mailing list