-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added manifest.json and service-worker.js
- Loading branch information
1 parent
0239b52
commit 3d31bc9
Showing
46 changed files
with
10,814 additions
and
0 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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.
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.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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,62 @@ | ||
{ | ||
"name": "privacy.sexy", | ||
"short_name": "privacy.sexy", | ||
"description": "Enforce privacy & security best-practices on Windows, macOS and Linux, because privacy is sexy.", | ||
"version": "0.13.5", | ||
"start_url": "/", | ||
"display": "standalone", | ||
"background_color": "#ffffff", | ||
"theme_color": "#000000", | ||
"icons": [ | ||
{ | ||
"src": "icons/manifest-icon-192.maskable.png", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"purpose": "any" | ||
}, | ||
{ | ||
"src": "icons/manifest-icon-192.maskable.png", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"purpose": "maskable" | ||
}, | ||
{ | ||
"src": "icons/manifest-icon-512.maskable.png", | ||
"sizes": "512x512", | ||
"type": "image/png", | ||
"purpose": "any" | ||
}, | ||
{ | ||
"src": "icons/manifest-icon-512.maskable.png", | ||
"sizes": "512x512", | ||
"type": "image/png", | ||
"purpose": "maskable" | ||
} | ||
], | ||
"screenshots": [ | ||
{ | ||
"src": "screenshots/screenshot-1280x720.png", | ||
"sizes": "1280x720", | ||
"type": "image/png", | ||
"form_factor": "wide" | ||
}, | ||
{ | ||
"src": "screenshots/screenshot-1366x768.png", | ||
"sizes": "1366x768", | ||
"type": "image/png", | ||
"form_factor": "wide" | ||
}, | ||
{ | ||
"src": "screenshots/screenshot-1600x900.png", | ||
"sizes": "1600x900", | ||
"type": "image/png", | ||
"form_factor": "wide" | ||
}, | ||
{ | ||
"src": "screenshots/screenshot-1920x1080.png", | ||
"sizes": "1920x1080", | ||
"type": "image/png", | ||
"form_factor": "wide" | ||
} | ||
] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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 @@ | ||
// Event listener for when the service worker is installed | ||
self.addEventListener('install', (event) => { | ||
// Log that the service worker has been installed | ||
console.log('Service Worker: Installed'); | ||
|
||
// Open a cache called 'app-cache' and add the following URLs to it | ||
event.waitUntil( | ||
caches.open('app-cache').then((cache) => { | ||
return cache.addAll([ | ||
'/', // root URL | ||
'/index.html', // main HTML file | ||
'/app.js', // main JavaScript file | ||
'/styles.css', // main CSS file | ||
'/images/logo.png', // logo image | ||
]); | ||
}), | ||
); | ||
}); | ||
|
||
// Event listener for when the service worker receives a fetch event | ||
self.addEventListener('fetch', (event) => { | ||
// Log that the service worker is fetching a URL | ||
console.log('Service Worker: Fetching', event.request.url); | ||
|
||
// Respond with a cached response if it exists, otherwise fetch the URL | ||
event.respondWith( | ||
caches.match(event.request).then((response) => { | ||
// If a cached response exists, return it | ||
if (response) { | ||
console.log('Service Worker: Found in cache', event.request.url); | ||
return response; | ||
} | ||
|
||
// If no cached response exists, fetch the URL and cache the response | ||
const fetchRequest = event.request.clone(); | ||
return fetch(fetchRequest).then((response) => { | ||
// If the response is not valid, return it without caching | ||
if (!response || response.status !== 200 || response.type !== 'basic') { | ||
return response; | ||
} | ||
|
||
// Cache the response and return it | ||
const responseToCache = response.clone(); | ||
caches.open('app-cache').then((cache) => { | ||
cache.put(event.request, responseToCache); | ||
}); | ||
return response; | ||
}); | ||
}), | ||
); | ||
}); | ||
|
||
// Event listener for when the service worker is activated | ||
self.addEventListener('activate', (event) => { | ||
// Log that the service worker has been activated | ||
console.log('Service Worker: Activated'); | ||
|
||
// Remove old caches that start with 'app-' except for 'app-cache' | ||
event.waitUntil( | ||
caches.keys().then((cacheNames) => { | ||
return Promise.all( | ||
cacheNames.filter((cacheName) => { | ||
return cacheName.startsWith('app-') && cacheName !== 'app-cache'; | ||
}).map((cacheName) => { | ||
return caches.delete(cacheName); | ||
}), | ||
); | ||
}), | ||
); | ||
}); | ||
|