-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
412 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,49 @@ | ||
{ | ||
"short_name": "Reddit Client", | ||
"name": "Unofficial reddit client redesign", | ||
"theme_color": "#f58415", | ||
"background_color": "#fcf9f7", | ||
"display": "standalone", | ||
"scope": "/", | ||
"start_url": "/", | ||
"name": "Reddit Client", | ||
"short_name": "RC", | ||
"app_name": "Reddit Client", | ||
"description": "Unofficial reddit client redesign", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
"src": "/images/icons/android-icon-36x36.png", | ||
"sizes": "36x36", | ||
"type": "image/png", | ||
"density": "0.75" | ||
}, | ||
{ | ||
"src": "/images/icons/android-icon-48x48.png", | ||
"sizes": "48x48", | ||
"type": "image/png", | ||
"density": "1.0" | ||
}, | ||
{ | ||
"src": "/images/icons/android-icon-72x72.png", | ||
"sizes": "72x72", | ||
"type": "image/png", | ||
"density": "1.5" | ||
}, | ||
{ | ||
"src": "/images/icons/android-icon-96x96.png", | ||
"sizes": "96x96", | ||
"type": "image/png", | ||
"density": "2.0" | ||
}, | ||
{ | ||
"src": "/images/icons/android-icon-144x144.png", | ||
"sizes": "144x144", | ||
"type": "image/png", | ||
"density": "3.0" | ||
}, | ||
{ | ||
"src": "/images/icons/android-icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"density": "4.0" | ||
} | ||
], | ||
"start_url": ".", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* eslint-disable no-underscore-dangle */ | ||
/* eslint-disable no-restricted-globals */ | ||
/// <reference lib="webworker" /> | ||
|
||
// This service worker can be customized! | ||
// See https://developers.google.com/web/tools/workbox/modules | ||
// for the list of available Workbox modules, or add any other | ||
// code you'd like. | ||
// You can also remove this file if you'd prefer not to use a | ||
// service worker, and the Workbox build step will be skipped. | ||
|
||
import { clientsClaim } from 'workbox-core'; | ||
import { ExpirationPlugin } from 'workbox-expiration'; | ||
import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching'; | ||
import { registerRoute } from 'workbox-routing'; | ||
import { StaleWhileRevalidate } from 'workbox-strategies'; | ||
|
||
declare const self: ServiceWorkerGlobalScope; | ||
|
||
clientsClaim(); | ||
|
||
precacheAndRoute(self.__WB_MANIFEST); | ||
|
||
const fileExtensionRegexp = new RegExp('/[^/?]+\\.[^/]+$'); | ||
registerRoute( | ||
// Return false to exempt requests from being fulfilled by index.html. | ||
({ request, url }: { request: Request; url: URL }) => { | ||
if (request.mode !== 'navigate') { | ||
return false; | ||
} | ||
|
||
// If this is a URL that starts with /_, skip. | ||
if (url.pathname.startsWith('/_')) { | ||
return false; | ||
} | ||
|
||
// If this looks like a URL for a resource, because it contains | ||
// a file extension, skip. | ||
if (url.pathname.match(fileExtensionRegexp)) { | ||
return false; | ||
} | ||
|
||
return true; | ||
}, | ||
createHandlerBoundToURL(`${process.env.PUBLIC_URL}/index.html`), | ||
); | ||
|
||
registerRoute( | ||
// Add in any other file extensions or routing criteria as needed. | ||
({ url }) => | ||
url.origin === self.location.origin && url.pathname.endsWith('.png'), | ||
// Customize this strategy as needed, e.g., by changing to CacheFirst. | ||
new StaleWhileRevalidate({ | ||
cacheName: 'images', | ||
plugins: [ | ||
// Ensure that once this runtime cache reaches a maximum size the | ||
// least-recently used images are removed. | ||
new ExpirationPlugin({ maxEntries: 50 }), | ||
], | ||
}), | ||
); | ||
|
||
// This allows the web app to trigger skipWaiting via | ||
// registration.waiting.postMessage({type: 'SKIP_WAITING'}) | ||
self.addEventListener('message', (event) => { | ||
if (event.data && event.data.type === 'SKIP_WAITING') { | ||
self.skipWaiting(); | ||
} | ||
}); | ||
|
||
// Any other custom service worker logic can go here. |
Oops, something went wrong.