yeah im gonna fucking KILL MYSELF FUCKING FGGOGHT AIJKESH DAKJSHd akshd asd
This commit is contained in:
142
sw.js
142
sw.js
@ -1,77 +1,77 @@
|
|||||||
// importScripts(
|
importScripts(
|
||||||
// 'https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js'
|
'https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js'
|
||||||
// );
|
);
|
||||||
|
|
||||||
// let localStorageData = {
|
let localStorageData = {
|
||||||
// cdns: [],
|
cdns: [],
|
||||||
// disableCDN: true,
|
disableCDN: true,
|
||||||
// };
|
};
|
||||||
// // yandere sim big files, cuphead, ddlc assets, renpy, renpy, buckshot roulette, half life, undertale & deltarune, hollow knight
|
// yandere sim big files, cuphead, ddlc assets, renpy, renpy, buckshot roulette, half life, undertale & deltarune, hollow knight
|
||||||
// let cacheable_files = ["YandereSim.data", "cuphead/Build/Build.data.unityweb.", "/ddlc/game/", "/co09/game/", "/co09flipside/game/", "/co09reup/game/", "renpy.data", "game.zip", "buckshot-roulette.pck", "halva_en-", "game.unx", "bog.data", "FTFHAPort.data.unityweb"];
|
let cacheable_files = ["YandereSim.data", "cuphead/Build/Build.data.unityweb.", "/ddlc/game/", "/co09/game/", "/co09flipside/game/", "/co09reup/game/", "renpy.data", "game.zip", "buckshot-roulette.pck", "halva_en-", "game.unx", "bog.data", "FTFHAPort.data.unityweb"];
|
||||||
|
|
||||||
// self.addEventListener("message", e => {
|
self.addEventListener("message", e => {
|
||||||
// if(e.data && e.data.type == "localStorage") {
|
if(e.data && e.data.type == "localStorage") {
|
||||||
// localStorageData = e.data;
|
localStorageData = e.data;
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
|
|
||||||
// if(workbox) {
|
if(workbox) {
|
||||||
// self.skipWaiting();
|
self.skipWaiting();
|
||||||
// workbox.core.clientsClaim();
|
workbox.core.clientsClaim();
|
||||||
|
|
||||||
// workbox.routing.registerRoute(
|
workbox.routing.registerRoute(
|
||||||
// ({url}) => {
|
({url}) => {
|
||||||
// if(localStorageData.disableCDN) return false;
|
if(localStorageData.disableCDN) return false;
|
||||||
// if(localStorageData.cdns.length == 0) return false;
|
if(localStorageData.cdns.length == 0) return false;
|
||||||
// if(url.origin != location.origin) return false;
|
if(url.origin != location.origin) return false;
|
||||||
// if(!url.pathname.includes("/resources/")) return false;
|
if(!url.pathname.includes("/resources/")) return false;
|
||||||
// for (const file of cacheable_files) {
|
for (const file of cacheable_files) {
|
||||||
// if(url.pathname.includes(file)) return true;
|
if(url.pathname.includes(file)) return true;
|
||||||
// }
|
}
|
||||||
// return false;
|
return false;
|
||||||
// },
|
},
|
||||||
// async ({url}) => {
|
async ({url}) => {
|
||||||
// let cdn = localStorageData.cdns[0];
|
let cdn = localStorageData.cdns[0];
|
||||||
// console.warn(url.href);
|
console.warn(url.href);
|
||||||
// return Response.redirect(cdn + url.pathname, 302);
|
return Response.redirect(cdn + url.pathname, 302);
|
||||||
// }
|
}
|
||||||
// );
|
);
|
||||||
|
|
||||||
// workbox.routing.registerRoute(
|
workbox.routing.registerRoute(
|
||||||
// /\.(?:png|gif|jpg|jpeg|svg|webp|avif|gif)$/,
|
/\.(?:png|gif|jpg|jpeg|svg|webp|avif|gif)$/,
|
||||||
// new workbox.strategies.CacheFirst({
|
new workbox.strategies.CacheFirst({
|
||||||
// cacheName: 'images-cache',
|
cacheName: 'images-cache',
|
||||||
// plugins: [
|
plugins: [
|
||||||
// new workbox.expiration.ExpirationPlugin({
|
new workbox.expiration.ExpirationPlugin({
|
||||||
// maxEntries: 1200,
|
maxEntries: 1200,
|
||||||
// maxAgeSeconds: 365 * 24 * 60 * 60,
|
maxAgeSeconds: 365 * 24 * 60 * 60,
|
||||||
// }),
|
}),
|
||||||
// ],
|
],
|
||||||
// })
|
})
|
||||||
// );
|
);
|
||||||
// workbox.routing.registerRoute(
|
workbox.routing.registerRoute(
|
||||||
// /.*resources\/(semag|sppa).*/,
|
/.*resources\/(semag|sppa).*/,
|
||||||
// new workbox.strategies.CacheFirst({
|
new workbox.strategies.CacheFirst({
|
||||||
// cacheName: 'resources-cache',
|
cacheName: 'resources-cache',
|
||||||
// plugins: [
|
plugins: [
|
||||||
// new workbox.expiration.ExpirationPlugin({
|
new workbox.expiration.ExpirationPlugin({
|
||||||
// maxEntries: 500,
|
maxEntries: 500,
|
||||||
// maxAgeSeconds: 365 * 24 * 60 * 60,
|
maxAgeSeconds: 365 * 24 * 60 * 60,
|
||||||
// }),
|
}),
|
||||||
// ],
|
],
|
||||||
// })
|
})
|
||||||
// );
|
);
|
||||||
|
|
||||||
// workbox.routing.registerRoute(
|
workbox.routing.registerRoute(
|
||||||
// /.*resources\/(games|apps)\.json$/,
|
/.*resources\/(games|apps)\.json$/,
|
||||||
// new workbox.strategies.StaleWhileRevalidate({
|
new workbox.strategies.StaleWhileRevalidate({
|
||||||
// cacheName: 'json-cache',
|
cacheName: 'json-cache',
|
||||||
// plugins: [
|
plugins: [
|
||||||
// new workbox.expiration.ExpirationPlugin({
|
new workbox.expiration.ExpirationPlugin({
|
||||||
// maxAgeSeconds: 3 * 60 * 60,
|
maxAgeSeconds: 3 * 60 * 60,
|
||||||
// maxEntries: 2,
|
maxEntries: 2,
|
||||||
// }),
|
}),
|
||||||
// ],
|
],
|
||||||
// })
|
})
|
||||||
// );
|
);
|
||||||
// };
|
};
|
||||||
Reference in New Issue
Block a user