├── CONTRIBUTING.md ├── README.md ├── images ├── add_to_apps.png ├── addtohomescreen.jpg ├── addtohomescreen │ ├── addtohome_android.png │ ├── addtohome_fxos.png │ ├── addtohome_ios.png │ ├── addtohomescreen.pxm │ ├── bookmark_android.png │ ├── bookmark_fxos.png │ ├── bookmark_io.png │ ├── bookmark_wp.png │ ├── old_addtohomescreen.jpg │ ├── trigger_action_ios.png │ ├── trigger_android.png │ └── trigger_fxos.png ├── desktop_bookmarking.png ├── early_addtohomescreen.jpg ├── early_addtohomescreen.pxm ├── favicon.png ├── favicons.png ├── iOS_homescreen.png ├── ios_default_tab.png ├── ios_icon_screenshot.png ├── ios_integration.jpg ├── ios_privacy.png ├── mobile_bookmarks.jpg ├── mobile_bookmarks.pxm ├── nativeapp_icons.jpg ├── nav_to_google.png ├── pin.jpg ├── pin_to_start.png ├── pin_wp.png ├── side-by-side.jpg └── sources │ └── nativeapp_icons.pxm ├── index.html ├── ios_standalone ├── README.md ├── images │ ├── add_to_homescreen.jpg │ ├── bookmark.png │ ├── github.png │ ├── mobile_vs_desktop.jpg │ ├── simulator.jpg │ ├── slashdot.jpg │ ├── slashdot_icon.png │ └── webcamtoy.jpg └── video │ └── slashdot.mp4 ├── respecConfig.js ├── sections └── names.html └── tidyconfig.txt /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | This spec is written using [ReSpec](http://w3.org/respec/). For 2 | configuration options, etc. please see the [ReSpec 3 | refeference](www.w3.org/respec/ref.html). 4 | 5 | Please make sure you run [HTML5 Tidy](http://w3c.github.io/tidy-html5/) before 6 | sending a Pull Request: 7 | 8 | ```Bash 9 | tidy -config tidyconfig.txt -o index.html index.html 10 | ``` 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Installable Webapps 2 | =================== 3 | 4 | [Use cases and requirements](http://w3c-webmob.github.io/installable-webapps/) for installable web apps. 5 | 6 | This document informs the [W3C's manifest spec](http://w3c.github.io/manifest/). 7 | 8 | -------------------------------------------------------------------------------- /images/add_to_apps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/add_to_apps.png -------------------------------------------------------------------------------- /images/addtohomescreen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen.jpg -------------------------------------------------------------------------------- /images/addtohomescreen/addtohome_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/addtohome_android.png -------------------------------------------------------------------------------- /images/addtohomescreen/addtohome_fxos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/addtohome_fxos.png -------------------------------------------------------------------------------- /images/addtohomescreen/addtohome_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/addtohome_ios.png -------------------------------------------------------------------------------- /images/addtohomescreen/addtohomescreen.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/addtohomescreen.pxm -------------------------------------------------------------------------------- /images/addtohomescreen/bookmark_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/bookmark_android.png -------------------------------------------------------------------------------- /images/addtohomescreen/bookmark_fxos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/bookmark_fxos.png -------------------------------------------------------------------------------- /images/addtohomescreen/bookmark_io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/bookmark_io.png -------------------------------------------------------------------------------- /images/addtohomescreen/bookmark_wp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/bookmark_wp.png -------------------------------------------------------------------------------- /images/addtohomescreen/old_addtohomescreen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/old_addtohomescreen.jpg -------------------------------------------------------------------------------- /images/addtohomescreen/trigger_action_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/trigger_action_ios.png -------------------------------------------------------------------------------- /images/addtohomescreen/trigger_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/trigger_android.png -------------------------------------------------------------------------------- /images/addtohomescreen/trigger_fxos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/addtohomescreen/trigger_fxos.png -------------------------------------------------------------------------------- /images/desktop_bookmarking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/desktop_bookmarking.png -------------------------------------------------------------------------------- /images/early_addtohomescreen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/early_addtohomescreen.jpg -------------------------------------------------------------------------------- /images/early_addtohomescreen.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/early_addtohomescreen.pxm -------------------------------------------------------------------------------- /images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/favicon.png -------------------------------------------------------------------------------- /images/favicons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/favicons.png -------------------------------------------------------------------------------- /images/iOS_homescreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/iOS_homescreen.png -------------------------------------------------------------------------------- /images/ios_default_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/ios_default_tab.png -------------------------------------------------------------------------------- /images/ios_icon_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/ios_icon_screenshot.png -------------------------------------------------------------------------------- /images/ios_integration.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/ios_integration.jpg -------------------------------------------------------------------------------- /images/ios_privacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/ios_privacy.png -------------------------------------------------------------------------------- /images/mobile_bookmarks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/mobile_bookmarks.jpg -------------------------------------------------------------------------------- /images/mobile_bookmarks.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/mobile_bookmarks.pxm -------------------------------------------------------------------------------- /images/nativeapp_icons.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/nativeapp_icons.jpg -------------------------------------------------------------------------------- /images/nav_to_google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/nav_to_google.png -------------------------------------------------------------------------------- /images/pin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/pin.jpg -------------------------------------------------------------------------------- /images/pin_to_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/pin_to_start.png -------------------------------------------------------------------------------- /images/pin_wp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/pin_wp.png -------------------------------------------------------------------------------- /images/side-by-side.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/side-by-side.jpg -------------------------------------------------------------------------------- /images/sources/nativeapp_icons.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w3c-webmob/installable-webapps/1289d506981ed12e236a13e037e6f1a7bffef86d/images/sources/nativeapp_icons.pxm -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |17 | This document provides an overview of how web applications have started 18 | to be integrated into native application environments, and outlines the 19 | use cases and requirements for a standard that could allow users to 20 | "install" web applications. The use cases and requirements were 21 | gathered by examining the landscape of proprietary solutions, and, 22 | where possible, by gathering statistics about the prevalence and usage 23 | patterns of particular solutions used in the wild. 24 |
25 |26 | Proprietary solutions that integrate web applications into the 27 | underlying operating system have been used in the wild for a few years 28 | now, so consolidation towards a standardized solution could potentially 29 | benefit users, developers, and browser vendors. 30 |
31 |34 | This document is undergoing heavy revision and changing on an almost 35 | daily basis. If you have any thoughts or comments about the content, 36 | please either join the public-webmob 38 | mailing list or file a 40 | bug on GitHub. All contributions welcome. 41 |
42 |48 | To launch native applications on either a desktop-class machine or a 49 | mobile device, users are generally presented with icons and 50 | corresponding labels that represent the applications installed on their 51 | system. Having the icons of web applications appear amongst 52 | applications that the user considers native (e.g., those on the home 53 | screen of a device) gives the perception to users that a web 54 | application has been "installed" - even if the processes that go into 55 | actually "installing" a web application differ from those of a native 56 | application. 57 |
58 |67 | At the time of writing, the web platform lacks a standardized means for 68 | a web application to indicate that it can be "installed" and treated as 69 | if it were an native application. As this document will show, the web 70 | platform also lacks sufficient metadata for a Web application to be 71 | successfully integrated into an underlying platform in the same way 72 | native applications are (i.e., not just on the homescreen, but 73 | integration into other contexts such as the task switcher, privacy 74 | and security settings, etc.). 75 |
76 |77 | Because of this gap in the web platform, browser vendors, including 78 | Google, Apple, Microsoft, and Mozilla, have implemented proprietary 79 | solutions that allow users to add web applications to the homescreen. 80 | To get a web application to more fully integrate with the OS, 81 | developers are sometimes required to use proprietary opt-in mechanisms, 82 | which we discuss later, to indicate to the browser that the web 83 | application can potentially work as a stand-alone application once it's 84 | added to the homescreen. These opt-in mechanisms primarily provide the 85 | OS with metadata (e.g., the icons and name of the application) so when 86 | the web application is added to the homescreen, it appears 87 | indistinguishable from an application that was natively installed. 88 |
89 |95 | To access a web application, users traditionally opened up a web 96 | browser, typed a URL or a search query into a search box, and had the 97 | browser navigate to the web application they wanted. Alternatively, a 98 | user may have "bookmarked" within a Web browser a set of web documents 99 | or web applications they commonly access. 100 |
101 |102 | More recently, browsers have started to monitor user's browsing habits 103 | to intelligently deduce which are the most common web sites the user 104 | likes to visit (i.e., a type of automatic bookmarking). The browser 105 | will then present visual links to those sites. Depending on the 106 | browser, user-defined and automatically-gleaned bookmarks will appear 107 | as a list of document titles or file names in either a drop-down menu, 108 | "speed-dial" 110 | entries, a toolbar, and/or a dedicated application window or tab. All 111 | these bookmark types are illustrated below. 112 |
113 |129 | On mobile devices, the interaction model has traditionally been the 130 | same as the one described above: historically, there's been a clear 131 | distinction between opening a native application and accessing a web 132 | application. That is, to access a Web application a user needs to 133 | first locate the Web browser they want to use, launch it, and then 134 | either type-in a URL or select a bookmark. Web browsers on mobile 135 | operating systems have thus added similar bookmarking facilities as 136 | those found in desktop-class browsers. This is shown below. 137 |
138 |149 | The bookmarking facilities of mobile browsers helps reduce some of 150 | the burden of typing URLs. Particularly for sites that the user 151 | visits regularly, it means that a web site can be accessed by a 152 | single press. Additionally, bookmarking facilities help separate 153 | native applications from web sites the user needs to access for other 154 | reasons (e.g., a particular wiki page on an intranet, a document with 155 | commonly required information, etc.). 156 |
157 |158 | The following table shows some examples of how a user bookmarks a 159 | page on a mobile browser. Both iOS and Android provide the user with 160 | the ability to customize the name of the bookmark, as well as 161 | organize the bookmark by placing it into a particular location. 162 | Firefox OS, however, simply let's the user "star" a page - this gives 163 | the user the option to bookmark the page. Once bookmarked, the site 164 | is added to a bookmarks tab (not shown below), which, unlike other 165 | mobile browsers, does not provide a means to manipulate the metadata 166 | of the bookmark. On Windows Phone the user can "add favorite". It 167 | does not allow the user to choose the location when adding a site, 168 | however, IE Mobile has a separated option called, "Pin to start". 169 |
170 |176 | iOS Safari 177 | | 178 |179 | Android Default Browser 180 | | 181 |182 | Firefox OS 1.1 183 | | 184 |185 | Windows Phone 8 IE 10 186 | | 187 |
---|---|---|---|
190 | ![]() |
192 |
193 | ![]() |
195 |
196 | ![]() |
198 |
199 | ![]() |
201 |
209 | Because basic bookmarks contain links to a range of different types 210 | of resources, the bookmarking facilities of desktop and mobile 211 | browsers do not integrate into an operating system's application 212 | menu. This means that web applications and "native" applications are 213 | treated as different things. This separation makes sense for many 214 | kinds of web sites (e.g., static, informational websites that provide 215 | little other functionality), but there is a range of applications 216 | that can provide an experience that is analogous to that provided by 217 | an application installed locally on a user's device (e.g., a game, an 218 | office productivity suite, a news or social networking site, a 219 | currency converter or photo manipulation utility, etc.). That said, 220 | it is users who are in the best position to decide what they consider 221 | an "app" and where they would like to access it from (either as a 222 | bookmark or as one of their locally installed applications). 223 |
224 |225 | As shown below, this desire to treat websites as applications has led 226 | at least one browser maker to attempt to replicate the homescreen 227 | experience directly in the browser itself. 228 |
229 |242 | Although this is a convenient way to access web sites, there are web 243 | applications that would benefit users if they were directly available 244 | from where the user normally accesses their installed applications. 245 | Also relegating web applications to this second homescreen means that 246 | web applications are treated as "second-class citizens": in the sense 247 | that in order to access these applications, a user must first launch 248 | the correct browser (from potentially a range of different browsers), 249 | and then press the icon for the application they wish to load. 250 |
251 |257 | From the discussion above, we can conclude that the key bits of 258 | information that are needed to enable bookmarking are: 259 |
260 |297 | Ideally, web applications should be immediately available to users 298 | without them needing to launch a separate application (a web browser) 299 | and having to type a URL. A user may have found a web application 300 | through browsing the web (e.g., through a search engine, via a link 301 | given to them by a friend on a social network, or through a website 302 | that works as an "app store"), but once added to the homescreen, the 303 | developer needs to be able to control if in web application opens in a 304 | Web browser environment or if the application is launched 305 | standalone: that is, once the application is launched, it 306 | appears indistinguishable from a native application by allowing the OS 307 | to treat it as equivalent to a native application. This includes, but 308 | is not limited to, integration with OS facilities such as the task 309 | switcher and doing away with browser UI chrome (the address bar, 310 | forward/back buttons, etc.). 311 |
312 |313 | Some browser makers have long acknowledged this as something developers 314 | want and that users could benefit from: iOS's Safari has had the 315 | capability to add a website to the homescreen since early 2008 (as of 316 | version 1.1.3, as shown in the figure below); the Android's stock 317 | browser has provided the capability to "add to homescreen" since at 318 | least 2009. Windows 8 also provides a similar capability, called 319 | "pinning", which we discuss in more detail below. 320 |
321 |331 | The ability to add a web site to the homescreen didn't automatically 332 | make a web application look, feel, or integrate into the operating 333 | system in the same way as native applications did. For instance, 334 | originally in iOS, launching a web application that had been added to 335 | the homescreen took the user back into Safari; in other words, it 336 | worked just like a traditional bookmark. It was only with the release 337 | of iOS 2.2 in September 2008 that applications that had been added to 338 | the home screen gained the capability to be displayed full screen 339 | (i.e., doing away with Safari's application chrome, as shown below). 340 | Apple did this by introducing a proprietary bit of HTML which 341 | developers could make use of if they so chose to. The result of using 342 | this proprietary switch is shown below. 343 |
344 |359 | Windows 8 also provides similar capabilities, but in two different 360 | forms: one allows a user to "Add site to Apps", meaning that a shortcut 361 | icon to a web application is added amongst natively installed 362 | applications. This is shown below. 363 |
364 |374 | The second type of bookmarking supported by Internet Explorer is 375 | pinning: this adds the site as a "live tile" to the homescreen. To best 376 | support this functionality, the developer needs to include some 377 | proprietary metadata for the icons and for how often the tile should be 378 | updated. The site is not actually presented in the live tile, but an 379 | RSS feed is used instead. 380 |
381 |399 | What initially started as a way to add a link to the homescreen has 400 | incrementally evolved to diminish the functional differences between a 401 | web application and a native application. This has not happened on the 402 | OS level alone: progress on the web platform, such as the ability to 403 | make content available off-line, performance gains through hardware 404 | acceleration, and integration 406 | with native form controls, has assisted in diminishing these 407 | differences. 408 |
409 |410 | But it should be noted that being able to have bookmarks outside the 411 | web browser is not something particularly new or noble. Desktop 412 | browsers have had that capability for possibly over a decade. However, 413 | giving developers the choice to tightly integrate their web 414 | applications into the OS directly from the Web browser is still 415 | somewhat new (hence all the proprietary switches and fragmentation in 416 | this space). This is different from packaged applications (zipped-up 417 | HTML applications) or hybrid application (applications that are 418 | distributed as native applications, but rely on a Webview), in that 419 | they applications are "installed" directly from the browser itself 420 | rather than from an app store. 421 |
422 |428 | iOS 7's Safari 429 | | 430 |431 | Android's Stock browser 432 | | 433 |434 | Firefox OS 1.1 435 | | 436 |
---|---|---|
439 | ![]() |
441 |
442 | ![]() |
444 |
445 | ![]() |
447 |
454 | Web Applications that opt-into being run standalone have somewhat 455 | different requirements to web applications a user has bookmarked to 456 | the homescreen. This is because OS level facilities of interacting 457 | with and controlling native applications are different from those of 458 | a web browsers. 459 |
460 |461 | In order for a web application to be "installed" in such a way that 462 | it provides a user experience that is indistinguishable from that of 463 | a native application, a number of key things are needed. This list 464 | compliments the list of things needed for bookmarking: 465 |
466 |565 | As already discussed, web applications can be added to the homescreen 566 | of a device in such a manner that they behave just like bookmarks. That 567 | is, once added to the homescreen, when the icon of the web application 568 | is activated, a web browser is launched and the desired web page is 569 | loaded. 570 |
571 |572 | However, through various proprietary opt-in mechanisms, developers are 573 | able to inform the browser that the application is able to work 574 | "standalone": that is, it is able to function without the user 575 | interface chrome of a browser - which typically means an web 576 | application will be launched in full screen. Depending on the OS and 577 | browser, these opt-in mechanisms can have various side-effects. One 578 | such web application, Forecast.io, is 579 | shown below running in iOS. 580 |
581 |596 | In iOS, then means by which an application developer indicates that 597 | their application can be run "standalone" is by using a meta element 598 | that takes the following form: 599 |
600 |601 | <meta name="apple-mobile-web-app-capable" content="yes"> 602 |603 |
604 | By declaring the above in a document, iOS will launch an application 605 | that has been added to the home page in fullscreen (without any 606 | browser chrome). 607 |
608 |609 | If the meta tag is omitted, and a user adds a page to the home 610 | screen, then the web application simply opens in a tab within Safari. 611 |
612 |613 | We analysed the October 614 | data set and found 844 sites declared 615 | "apple-mobile-web-app-capable". 616 |
617 |618 | TODO: Discuss that a side effect is the following practice, which can 619 | range from the annoying to the just bad and requires browser sniffing 620 | (so you know where to point the "add to home screen" arrow, which is 621 | different on every browser). Having an API might help with this 622 | problem, but allowing developers to be a bit more descrete about 623 | adding to homescreen. 624 |
625 |
640 | Google Chrome Beta for Android reuses Apple's convention of using a
641 | meta tag whose name is "apple-mobile-web-app-capable
".
642 | It also introduces it's own value
643 | "mobile-web-app-capable
".
644 |
646 | <meta name="mobile-web-app-capable" content="yes"> 647 |648 |
649 | By declaring the above in a document, Chrome will launch an 650 | application that has been added to the home page in fullscreen 651 | (without any browser chrome). 652 |
653 |
654 | If the meta
element is missing, then the site is
655 | launched as a tab within Chrome.
656 |
658 | We analysed the October 659 | data set and found 9 sites declared "mobile-web-app-capable". 4 660 | of those websites declared "apple-mobile-web-app-capable" too. 661 |
662 |
668 | Firefox OS lacks a way to declaratively indicate to the Web browser
669 | that the application can run standalone when launched. Instead,
670 | Firefox OS relies on an API to provide this functionality. The
671 | mozApps.install()
method takes a url to a JSON file as
672 | an argument. The JSON file supplies Firefox OS with the relevant
673 | metadata (e.g., application's name, URLs for the icons, etc.) needed
674 | to make installation possible.
675 |
677 | navigator.mozApps.install(pathToManifest); 678 |679 |
687 | The Web platform provides two
688 | standardized means to associate icons with a Web application: one being
689 | the link
element with the icon
link
690 | relationship, and two being the favicon.ico
- which is a
691 | graphical resource that a developer places at the root of a site, and
692 | which user agents will automatically attempt to fetch after a document
693 | has loaded.
694 |
696 | Unfortunately, despite the above two standardized solutions being part 697 | of the platform since at least 2008, support for the above is lacking 698 | and so various proprietary solutions have emerged and continue to 699 | proliferate. This is particularly the case for user agents that support 700 | adding applications to the home screen of a device. For example: 701 |
702 |link
elements whose
709 | relationship is "apple-touch-icon
". It also
710 | automatically searches the root of a website for specially named
711 | files (e.g., "apple-touch-icon-57x57-precomposed.png").
712 | apple-touch-icon
" links if it
719 | encounters them in a HTML document, but it will not automatically
720 | scan the root of a site for those icons.
721 | meta
elements described below. Like with iOS, when a site is pinned, it also
729 | automatically scans the root of a site for specifically named files
730 | to use as icons.
731 | icon
link relationship
736 |
738 | To associate an icon with a web application, HTML recommends using a
739 | link
element whose link relationship is
740 | "icon
". For example:
741 |
743 | <link rel="icon" sizes="196x196" href="icon"> 744 |745 |
746 | As stated in the [[!HTML] specification: 747 |
748 |749 |760 |Icons could be auditory icons, visual icons, or other kinds of 750 | icons. If multiple icons are provided, the user agent must select the 751 | most appropriate icon according to the type, media, and sizes 752 | attributes. If there are multiple equally appropriate icons, user 753 | agents must use the last one declared in tree order at the time that 754 | the user agent collected the list of icons. If the user agent tries 755 | to use an icon but that icon is determined, upon closer examination, 756 | to in fact be inappropriate (e.g. because it uses an unsupported 757 | format), then the user agent must try the next-most-appropriate icon 758 | as determined by the attributes.759 |
761 | Allowing user agents to discriminate depending on media type, media 762 | query, and size potentially provides a complete responsive solution 763 | for icons: in that the user agent can use these data points to select 764 | the most appropriate icon for a particular context (see the use cases for responsive 766 | images). 767 |
768 |
769 | Despite what the [[!HTML]] specification recommends, support for
770 | discriminating on media, sizes, and type is limited: Given a set of
771 | icons, Gecko-based user agents will use the last known good icon (as
772 | per the [[HTML]] spec). However, no attempt is made to discriminate
773 | on size (via the link element's sizes
attribute).
774 | Additionally, Firefox for Android stylizes the icon when a web
775 | application is added to the home screen.
776 |
778 | Support in Mac OS's Safari is also spotty: given multiple icon
779 | choices, where the last is unavailable, Safari does not attempt to do
780 | any error recovery to find alternative icons. In addition, on iOS,
781 | link rel=icon
is not used for "add to homescreen" either
782 | - only the proprietary "apple-touch-icon" solution is supported
783 | (discussed below).
784 |
786 | Furtunately, <link rel=icon
> is fairly well
787 | supported on Chrome on both desktop and on iOS and Android, as is
788 | support in Windows 8: in the aformentioned user agents, the browser
789 | follows the [[HTML]] specification and select appropriate icons based
790 | on the sizes attribute. Both browsers also support error handling.
791 | Unfortunately, in Chrome Beta, when adding to home screen Chrome still
792 | selects the last icon in set, instead of discriminating on size -
793 | this can lead to the wrong icon being selected for the available icon
794 | size of the home screen.
795 |
802 | Favicons are small graphical icons commonly used by web browsers to 803 | help user's identify a site in the browser's user interface. They 804 | typically appear on tabs, in bookmark lists, and when viewing a 805 | browser's history. As favicons were a Microsoft creation, the 806 | proprietary ICO file 808 | format is a common format used for them. However, browsers are 809 | not restricted to the .ICO format, and all typical file formats used 810 | on the Web are supported (i.e., JPEG, PNG, and GIF). 811 |
812 |820 | A comprehensive 821 | history of favicons can be found on Wikipedia, as well as a 822 | description of the ICO file 824 | format. Relevant to this document is the level of 825 | interoperability of favicons in the platform: all user agents support 826 | favicons both through using a link relationship and by a developer 827 | placing a resource called "favicon.ico" at the root of a web site 828 | (i.e., at "/favicon.ico"). 829 |
830 |843 | When an application is added to the home screen of a device, and in 844 | the absence of dedicated proprietary icon declarations within a 845 | document, all user agents tested except iOS make use of favicons. 846 |
847 |848 | However, Gecko will only ever use the smallest icon in a set of 849 | favicons. Chrome and IE will most of the time select an approprietely 850 | sized icon for the context in which the icon is to be displayed. 851 |
852 |858 | In iOS, Apple provides a proprietary declarative solution for 859 | including icons in a HTML document - known as "touch icons". Apple 860 | iOS has supported touch icons since iOS 1.1.3 and other browsers, 861 | such as Chrome on Android, will also make use of these icons as a 862 | fallback when they are available. 863 |
864 |865 | For example: 866 |
867 |868 | <link rel="apple-touch-icon" href="apple-touch-icon.png"> 869 | 870 |871 |
872 | On iOS, when a web page doesn't specify a custom touch icon, the OS 873 | takes a screenshot of the webstie and creates an icon from it. This 874 | is shown below. 875 |
876 |881 | When an application is bookmarked, iOS automatically adds some visual 882 | effects to an icon so that it integrates more effectivly with the 883 | built-in icons on the home screen (as it does with application 884 | icons). Specifically, iOS adds: 885 |
886 |895 | As of iOS 2.0, a developer can prevent the addition of these effects 896 | by using the precomposed keyword: 897 |
898 |899 | <link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png"> 900 |901 |
902 | If no icons are specified in the HTML, iOS Safari will search the 903 | website’s root directory for icons with the apple-touch-icon or 904 | apple-touch-icon-precomposed prefix. For example, if the appropriate 905 | icon size for the device is 57 × 57 pixels, iOS searches for 906 | filenames in the following order: 907 |
908 |
919 | So, for iOS, it’s not necessary to use HTML to add touch icons to a
920 | site, even if one wants to use multiple resolution-specific icons.
921 | This helps avoid having to use proprietary <link
922 | rel="apple-touch-icon">
elements on every single HTML page.
923 | A developer just needs to create different versions of the icon, use
924 | the correct file names and place them in the root of the website.
925 |
932 | Android has a default system provided icon, and, as already mention, 933 | it will fall back to using a favicon if it’s available. 934 |
935 |936 | Although Android is able to fallback to using the iOS icons, the 937 | no-HTML approach doesn’t work on the Android browser (tested in 2.3 938 | Gingerbread, 3 Honeycomb, 4.1 Jelly Bean), although there is 939 | anectodotal evidence it does work 941 | in and 4.2 Jelly Bean’s default browser. 942 |
943 |
949 | Web applications intended to be "pinned" rely on meta elements whose
950 | name is "msapplication-square{w}x{h}logo
", where
951 | {w} and {h} are the width and height of the
952 | logo.
953 |
955 | Like iOS, when the proprietary declarations are missing, Windows will 956 | also search the root of a website for specifically named files that 957 | follow the afformentioned file name pattern. If no suitabile icons 958 | are found, Windows will fall back to using a favicon. 959 |
960 |961 | According to the 963 | IE Blog, Internet Explorer "only downloads the tile 964 | image when the user pins the site to his or her Start screen so sites 965 | don’t incur additional bandwidth costs. 966 |
967 |974 | The act of adding an application to the home screen serves as a cue to 975 | alter the security policy of an application. For example, in iOS, and 976 | application that has been added to the home screen will no longer share 977 | cookies, localStorage, IDB, etc. with the Safari Web browser. The OS 978 | will also reset all its API permissions, so, for example, any 979 | previously granted permission to access location services that occurred 980 | in the browser are forgotten once the application is added to the 981 | homescreen - the end-user will need to re-enable such permission again 982 | after the application is launched from the homescreen. 983 |
984 |985 | Furthermore, by adding the application to the home screen, the 986 | application gains its own independent privacy settings in iOS's privacy 987 | menus. This is shown in the figure below. 988 |
989 |1006 | A user can add a web application to the home screen from anywhere 1007 | within a website (e.g., while reading a document). Returning to that 1008 | same document when the application starts back up might not be ideally 1009 | what either the user or developer want. 1010 |
1011 |1012 | Standardized solutions: 1013 |
1014 |1015 | <head> 1016 | ... 1017 | <link rel="home" href="http://example.com"> 1018 | ... 1019 | </head> 1020 |1021 |
1022 | link[rel=home] found in 370 websites from Ocotober's dataset. 1023 |
1024 |1025 | ... http://microformats.org/wiki/rel-home 1026 |
1027 |
1028 | Proprietary uses: msapplication-starturl
(found in 403
1029 | sites from the October dataset, 8 of those also declared lin[rel=home])
1030 |
1032 | MS related info: 1033 | http://msdn.microsoft.com/en-us/library/ie/gg491732(v=vs.85).aspx 1034 |
1035 |1041 | An application's orientation can be unlocked, meaning that the layout 1042 | of the application can adapt to portrait or landscape, or can be locked 1043 | to either portrait, landscape. Portrait or landscape can be further 1044 | constrained to being flippable or not. Flippable means that if the 1045 | device is rotated 180 degrees, the display is also flipped. Otherwise, 1046 | the orientation remains locked. 1047 |
1048 |1049 | A developer may also want to lock to a different orientation depending 1050 | on the class of the device, the size of the screen, or the aspect ratio 1051 | of the screen used. For example, use portrait on a phone and landscape 1052 | on a tablet. For example, BBC iPlayer does this (on iOS?). 1053 |
1054 |1055 | Proprietary solutions - Firefox OS allows applications to be locked to 1056 | particular orientation through their manifest format 1057 |
1058 |1064 | The ability to navigate documents by activating hyperlinks is a 1065 | fundamental aspect of the Web platform. It's what makes the web, the 1066 | web. However, when applications are added to the homescreen of a 1067 | device, and indicate that they are able to function standalone, the 1068 | navigational behavior has some side effects. These side effects 1069 | generally emerge because the applications are launched in full screen 1070 | and devoid of any browser chrome, and so the are no visual indicators 1071 | for the user to get a sense of where they are (as they normally would 1072 | with an address bar). As such, different browsers deals with this 1073 | problem in different ways. 1074 |
1075 |1080 | Chrome allows users to freely navigate web documents by following 1081 | hyperlinks: this works both same origin and across origins. However, 1082 | if a user navigates away from the origin from which the application 1083 | was installed, a small bar with the new origin to be shown. This 1084 | appears to be done as a security precaution to give the user a better 1085 | sense of where they are (specially if they have unexpectedly been 1086 | navigated to another domain). 1087 |
1088 |1094 | In Windows 8, launching web applications that have been "added to 1095 | Apps" simply open again in IE. 1096 |
1097 |
1103 | On iOS, once an application is added to the homescreen,
1104 | hyperlink-based navigation from one document to another is no longer
1105 | possible by default: this is because in iOS, the "default behavior"
1106 | of activating a link is to open the link in Safari (note however,
1107 | navigating within the document itself via fragment identifiers is
1108 | still possible). The default behavior can be prevented by capturing
1109 | all click events generated by HTML a
elements. Once an
1110 | event has been captured, and prevented from performing the default
1111 | action, then the window.location
can be manually set by
1112 | script. Preventing the default behavior and manually handling the
1113 | navigation is illustrated by the code below.
1114 |
1116 | document.addEventListener("click", function (e) { 1117 | var elem = e.target; 1118 | if (elem.tagName && elem.tagName === "A") { 1119 | e.preventDefault(); 1120 | location.href = elem.href; 1121 | } 1122 | }); 1123 |1124 |
1125 | Once click events are captured and the default behavior prevented, it 1126 | becomes possible not only to navigate a document within the same 1127 | origin, but also to other origins. However, every document will need 1128 | to include code similar to the one above in order for navigation via 1129 | hyperlinks to continue to work. 1130 |
1131 |1137 | ... 1138 |
1139 |1146 | A standardized solution: 1147 |
1148 |1207 | The bulk of the text in the icons section was adapted from Mathias Bynens' article "Everything you always 1210 | wanted to know about touch icons". With Mathias' permission, the 1211 | bulk of that text and examples are reproduced in this document. 1212 |
1213 |Native platforms sometimes allow developers to define more than one display 6 | name for different use cases. The three options are:
7 | 8 |iOS and Android developers also need to define a listings name during the 20 | application submission process to the store which is used in the store 21 | listings. The Windows Store, on the other hand, requires developers to use the 22 | same app name in the manifest and the store.
23 | 24 |Web applications have traditionally used the "title" element since it was 27 | available in the standards. However, due to HTML's origin as a 28 | document-publishing format, titles are applied "per page" and tend to be more 29 | descriptive or include status messages. This is annoying. It means users have 30 | to fix the name when adding an app to the home screen to remove page-specific 31 | or status messages.
32 | 33 |HTML5 provides a solution, "application-name":
34 | 35 |<head> ... <meta name="application-name" content="Awesome App!"> ... </head>36 | 37 |
HTML says:
38 | 39 |40 |49 | 50 |The value must be a short free-form string giving the name of the Web 41 | application that the page represents. If the page is not a Web application, 42 | the application-name metadata name must not be used. There must not be more 43 | than one meta element with its name attribute set to the value 44 | application-name per document. User agents may use the application name in UI 45 | in preference to the page's title, since the title might include status 46 | messages and the like relevant to the status of the page at a particular 47 | moment in time instead of just being the name of the application.
48 |
54 |61 | 62 |The "application-name" metadata defines the name of the Pinned site 55 | application instance. This is the name that appears in a tooltip when 56 | hovering over the Pinned site button on the Windows 7 taskbar. The 57 | application name is also appended to the window title of the Pinned site 58 | application instance.
59 |If this element is missing, the document title is used instead.
60 |
Since iOS6, apple supports its own version of "application-name" metadata 65 | called "apple-mobile-web-app-title". However, it doesn't use 66 | "application-name"
67 | 68 |If "apple-mobile-web-app-title" is missing, the document title is used 69 | instead.
70 | 71 |Both, Chrome Mobile and Firefox for Android only use the title tag.
74 | 75 |We analysed the October data 78 | set (78,156 sites) to review the ussage of the different meta tags to 79 | define names:
80 | 81 |We also analysed the length of the content of these tags (TODO: FIX wrong 88 | numbers due to character encoding issues):
89 | 90 |metadata | 94 |min | 95 |max | 96 |mean | 97 |median | 98 |
"application-name" | 103 |2 | 104 |312 | 105 |20 | 106 |13 | 107 |
"apple-mobile-web-app-title" | 110 |2 | 111 |190 | 112 |11 | 113 |8 | 114 |
All native platforms allow for localization of the manifest contents. The 121 | way they handle localization falls into two categories:
122 | 123 |xml:lang
and Firefox OS
131 | incluides a locales
property in the manifest.In both cases, the system gets the application name in the different 135 | languages and chooses which one to show based on the default language. If a 136 | user changes the device's default language, all applications with localized 137 | names in the new language would get the translated names.
138 | 139 |This is important to note since web localization is usually handled on the 140 | server and resources are served in just one language. E.g.: a web app would 141 | only have one "application-name" meta tag in the language of the 142 | HTML document. This means the device would only get one translation of the 143 | application name. If the user changed the default language, the device would 144 | not be able to translate the app name unless it requested the HTML document 145 | again in the new language.
146 | 147 | -------------------------------------------------------------------------------- /tidyconfig.txt: -------------------------------------------------------------------------------- 1 | char-encoding: utf8 2 | indent: yes 3 | wrap: 80 4 | tidy-mark: no 5 | --------------------------------------------------------------------------------