Guest User

Untitled

a guest
Jul 15th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. {
  2. "short_name": "React Notes",
  3. "name": "React PWA notes",
  4. "icons": [
  5. {
  6. "src": "staticAssets/favicon.png",
  7. "sizes": "64x64 32x32 24x24 16x16",
  8. "type": "image/png"
  9. },
  10. {
  11. "src": "staticAssets/icon-192.png",
  12. "sizes": "192x192",
  13. "type": "image/png"
  14. },
  15. {
  16. "src": "staticAssets/icon-512.png",
  17. "sizes": "512x512",
  18. "type": "image/png"
  19. }
  20. ],
  21. "start_url": "./index.html",
  22. "scope":"/",
  23. "display": "standalone",
  24. "theme_color": "#000000",
  25. "background_color": "#ffffff"
  26. }
  27.  
  28. self.__precacheManifest = [].concat(self.__precacheManifest || []);
  29.  
  30. workbox.precaching.suppressWarnings();
  31. workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
  32.  
  33. self.addEventListener('fetch', function(event) {
  34. event.respondWith(
  35. caches.match(event.request)
  36. .then(function(response) {
  37. // Cache hit - return response
  38. if (response) {
  39. return response;
  40. }
  41. return fetch(event.request);
  42. }
  43. )
  44. );
  45. });
  46.  
  47. ...
  48. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
  49. <meta name="theme-color" content="#000000">
  50. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  51. <meta name="apple-mobile-web-app-capable" content="yes">
  52.  
  53. <link rel="manifest" href="/manifest.json">
  54. ...
  55. <!-- here be apple specific icon stuff -->
  56.  
  57. new workboxPlugin.InjectManifest({
  58. swSrc: './src/sw.js',
  59. swDest: 'service-worker.js',
  60. importWorkboxFrom: 'local'
  61. })
Add Comment
Please, Sign In to add comment