From 538a9813a5abafbdef1ee4dbd1390e7bfb548463 Mon Sep 17 00:00:00 2001 From: Anssi Kostiainen Date: Thu, 21 Apr 2016 11:01:02 +0300 Subject: [PATCH 1/2] Review of the installation event feature (#453) - rename AppInstallEventHandlersMixin to AppInstallEventHandlers (seem more consistent with the way mixins are named in HTML) - fix JSHint warnings is examples (consistent use of semicolons) - link to terms that have s - fix typos, minor editorial rewording - make the monkey an HTML entity! - tidy --- index.html | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/index.html b/index.html index 118ea006..365ea214 100644 --- a/index.html +++ b/index.html @@ -201,16 +201,16 @@

For example, on user agents that support installation, a web - application could be presented and and launched in a way that, to the + application could be presented and launched in a way that, to the end-user, is indistinguishable from native applications: such as appearing as a labeled icon on the home screen, launcher, or start menu. When launched, the manifest is applied by the user agent - to the browsing context prior to the start URL being loaded. - This gives the user agent time to apply the relevant values of the - manifest, possibly changing the display mode and screen - orientation of the web application. Alternatively, and again as an - example, the user agent could install the web application into a - list of bookmarks within the user agent itself. + to the top-level browsing context prior to the start URL + being loaded. This gives the user agent time to apply the relevant + values of the manifest, possibly changing the display mode and + screen orientation of the web application. Alternatively, and again as + an example, the user agent could install the web application + into a list of bookmarks within the user agent itself.

An end-user can manually @@ -269,7 +269,7 @@

The steps to install the web application are given by the - following algorithm.: + following algorithm:

  1. Let window be the Window object of the @@ -282,8 +282,8 @@

    the manifest.

  2. If obtaining the manifest results in an error, a user - agent can, at this point, fall back to using the top-level browsing - contexts' Document's metadata to create an + agent can, at this point, fall back to using the top-level + browsing context' Document's metadata to create an installation process.
  3. If the installation succeeded, fire an event named @@ -297,8 +297,8 @@

    In the case that the end-user manually triggered the - installation process, the user agent MUST run the steps to install - the web application. + installation process, the user agent MUST run the steps to + install the web application.

    @@ -319,7 +319,7 @@

    It is RECOMMENDED that user agents prevent other applications from determining which applications are installed on the system (e.g., via a timing attack on the user agent's cache). This could be done by, - for example, invalidating from the user agent's cache resources were + for example, invalidating from the user agent's cache the resources linked to from the manifest (for example, icons) after a web application is installed - or by using an entirely different cache from that used for regular web browsing. @@ -373,19 +373,19 @@

    - AppInstallEventHandlersMixin mix-in + AppInstallEventHandlers mixin

    - The AppInstallEventHandlersMixin defines the event - handler attributes on which events relating to the installation of a - web application are fired. + The AppInstallEventHandlers mixin defines the + event handler attributes on which events relating to the + installation of a web application are fired.

               [NoInterfaceObject, exposed=(Window)]
    -          interface AppInstallEventHandlersMixin {
    +          interface AppInstallEventHandlers {
                 attribute EventHandler oninstall;
               };
    -          Window implements AppInstallEventHandlersMixin;
    +          Window implements AppInstallEventHandlers;
             

    @@ -394,14 +394,14 @@

     function handleInstall(ev){
       const date = new Date(ev.timeStamp / 1000);
    -  console.log(`Yay! Our app got installed at ${date.toTimeString()}`)
    +  console.log(`Yay! Our app got installed at ${date.toTimeString()}`);
     }
     
     // Using the event handler IDL attribute
     window.oninstall = handleInstall;
     
     // Using .addEventListener()
    -window.addEventListener("install", handleInstall)
    +window.addEventListener("install", handleInstall);
                 

    @@ -446,7 +446,7 @@

  4. Otherwise, return false.
-
+

Enforcing the navigation scope depends on [[!HTML]]'s navigate algorithm. As such, the following algorithm monkey patches [[!HTML]]. @@ -521,8 +521,8 @@

An application context can be instantiated through a deep link (a URL that is within scope of the installed web - application); in which case, the manifest is applied and the deep - link is loaded within the context of a web application. + application); in which case, the manifest is applied and the deep + link is loaded within the context of a web application.

From 9e78eeb9116eba03a53131489c3eb9da718beaef Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Fri, 22 Apr 2016 13:15:39 +1000 Subject: [PATCH 2/2] Fix the monkey --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 365ea214..9e051456 100644 --- a/index.html +++ b/index.html @@ -446,7 +446,7 @@

  • Otherwise, return false.
  • -
    +

    Enforcing the navigation scope depends on [[!HTML]]'s navigate algorithm. As such, the following algorithm monkey patches [[!HTML]].