| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <title>Web app banner test page</title> | 3 <title>Web app banner test page</title> |
| 4 <link rel="manifest" href="manifest.json" /> | |
| 5 <script src="main.js"></script> | 4 <script src="main.js"></script> |
| 6 <script> | 5 <script> |
| 6 // If a "manifest=/path/to/manifest.json" query argument is provided to |
| 7 // the URL accessing this page, that path is injected as the manifest tag. |
| 8 // Otherwise, "manifest.json" is used as the manifest tag. |
| 9 addManifestLinkTag(); |
| 10 |
| 7 window.addEventListener('beforeinstallprompt', function(e) { | 11 window.addEventListener('beforeinstallprompt', function(e) { |
| 8 console.log('Preventing banner from appearing'); | 12 console.log('Preventing banner from appearing'); |
| 9 e.preventDefault(); | 13 e.preventDefault(); |
| 10 | 14 |
| 11 // Navigate the window to trigger the banner cancellation. | 15 // Navigate the window to trigger the banner cancellation. |
| 12 window.location.href = "/"; | 16 window.location.href = "/"; |
| 13 }); | 17 }); |
| 14 </script> | 18 </script> |
| 15 </head> | 19 </head> |
| 16 <body onload="initialize()">Cancels the banner.</body> | 20 <body onload="initialize()">Cancels the banner.</body> |
| 17 </html> | 21 </html> |
| OLD | NEW |