From ec0101fbeab3c4be6eb3ca396281794dd3a2b966 Mon Sep 17 00:00:00 2001 From: kiritokatklian Date: Mon, 28 Oct 2024 23:10:34 +0100 Subject: [PATCH] [Fix] PWA 419 - Updated caching logic in `service-worker.js` for endpoints that throw a 419 error due to CSRF --- public/mix-manifest.json | 6 +++--- public/service-worker.js | 2 +- public/service-worker.js.map | 2 +- resources/js/service-worker.js | 39 +++++++++++++++++++++++++--------- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/public/mix-manifest.json b/public/mix-manifest.json index b3223c012..d07f7c813 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,15 +1,15 @@ { - "/service-worker.js": "/service-worker.js?id=8fafdcda754edcdf92a9f12485122a76", + "/service-worker.js": "/service-worker.js?id=da5076443ba1503a8b4d1544c3f32bbc", "/js/app.js": "/js/app.js?id=bfb318371cc2aa98549d231ff4e92923", "/js/debug.js": "/js/debug.js?id=96263e8fd2804cd940eec492686c7166", "/js/db.js": "/js/db.js?id=a06bca606acd39f89354a39a40d4a6b5", "/js/chat.js": "/js/chat.js?id=dfe6a3706173c6b8e1e2cd02de841b3e", "/js/listen.js": "/js/listen.js?id=d52eb953a91ec04ccea925982979e036", "/js/watch.js": "/js/watch.js?id=d160037b0ab7632b2c3fa045413c8c69", - "/js/worker.js": "/js/worker.js?id=6e9192583564be06582ff10c8232238d", + "/js/worker.js": "/js/worker.js?id=25119886f5be4b182ecb61f7c45808b6", "/js/manifest.js": "/js/manifest.js?id=b81b1cc0ce2d1b37420d58d44c9818a4", "/css/watch.css": "/css/watch.css?id=37709836971a8cf7bb59c82f2cd857dc", "/css/chat.css": "/css/chat.css?id=c94ecda28f343fe6f9a3f7e36744979d", - "/css/app.css": "/css/app.css?id=9ba2d04a52c709983a51ee8da56f4648", + "/css/app.css": "/css/app.css?id=445d07d4e4a29d91f7ff0ae0888977f7", "/js/vendor.js": "/js/vendor.js?id=742498b1190fdd921262243bf56ff08e" } diff --git a/public/service-worker.js b/public/service-worker.js index 64c0b61eb..9424ddc57 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -1,2 +1,2 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[402],{687:()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(r){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:S(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function L(){}var E={};l(E,s,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(I([])));j&&j!==o&&i.call(j,s)&&(E=j);var k=L.prototype=w.prototype=Object.create(E);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(o,a,c,s){var u=p(e[o],e,a);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==t(l)&&i.call(l,"__await")?r.resolve(l.__await).then((function(t){n("next",t,c,s)}),(function(t){n("throw",t,c,s)})):r.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,s)}))}s(u.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function S(t,e,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var s=N(c,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=p(t,e,n);if("normal"===u.type){if(o=n.done?g:v,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=g,n.method="throw",n.arg=u.arg)}}}function N(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,N(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;G(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),m}},n}function r(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}importScripts("https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox-sw.js");var n="general-cache-v1",o="offline.html",i=[o,"css/app.css","css/chat.css","css/watch.css","js/app.js","js/vendor.js","js/db.js","js/chat.js","js/listen.js","js/watch.js","images/static/icon/app_icon.webp"];function a(){var t;return t=e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:console.log("Background sync is triggered!");case 1:case"end":return t.stop()}}),t)})),a=function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)}))},a.apply(this,arguments)}self.addEventListener("message",(function(t){t.data&&"SKIP_WAITING"===t.data.type&&self.skipWaiting()})),self.addEventListener("install",(function(t){t.waitUntil(caches.open(n).then((function(t){return t.addAll(i)})))})),self.addEventListener("activate",(function(t){t.waitUntil(caches.keys().then((function(t){return Promise.all(t.map((function(t){if(t!==n)return caches.delete(t)})))})))})),self.addEventListener("fetch",(function(t){t.respondWith(caches.match(t.request).then((function(e){return e||fetch(t.request).then((function(e){return caches.open(n).then((function(r){return r.put(t.request,e.clone()),e}))}))})).catch((function(){return caches.match(o)})))})),self.addEventListener("sync",(function(t){"background-sync"===t.tag&&t.waitUntil(function(){return a.apply(this,arguments)}())})),self.addEventListener("push",(function(t){var e=t.data.json();self.registration.showNotification(e.title,{body:e.body,icon:"images/static/icon/app_icon.webp"})})),self.addEventListener("notificationclick",(function(t){var e=t.notification;t.action;e.close()})),self.addEventListener("notificationclose",(function(t){var e=t.notification;console.log("Notification closed:",e)}))},547:()=>{},115:()=>{},969:()=>{}},t=>{var e=e=>t(t.s=e);t.O(0,[120,713,252],(()=>(e(687),e(547),e(115),e(969))));t.O()}]); +(self.webpackChunk=self.webpackChunk||[]).push([[402],{687:()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(r){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:S(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function L(){}var E={};l(E,s,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(I([])));j&&j!==o&&i.call(j,s)&&(E=j);var k=L.prototype=w.prototype=Object.create(E);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(o,a,c,s){var u=p(e[o],e,a);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==t(l)&&i.call(l,"__await")?r.resolve(l.__await).then((function(t){n("next",t,c,s)}),(function(t){n("throw",t,c,s)})):r.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,s)}))}s(u.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function S(t,e,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var s=N(c,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=p(t,e,n);if("normal"===u.type){if(o=n.done?g:v,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=g,n.method="throw",n.arg=u.arg)}}}function N(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,N(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;G(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),m}},n}function r(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}importScripts("https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox-sw.js");var n="general-cache-v1",o="offline.html",i=[o,"css/app.css","css/chat.css","css/watch.css","js/app.js","js/vendor.js","js/db.js","js/chat.js","js/listen.js","js/watch.js","images/static/icon/app_icon.webp"],a=["/forgot-password","/merge-library","/reset-password","/sign-in","/sign-out","/sign-up","/siwa","/two-factor-authentication"];function c(){var t;return t=e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:console.log("Background sync is triggered!");case 1:case"end":return t.stop()}}),t)})),c=function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)}))},c.apply(this,arguments)}self.addEventListener("message",(function(t){t.data&&"SKIP_WAITING"===t.data.type&&self.skipWaiting()})),self.addEventListener("install",(function(t){t.waitUntil(caches.open(n).then((function(t){return t.addAll(i)})))})),self.addEventListener("activate",(function(t){t.waitUntil(caches.keys().then((function(t){return Promise.all(t.map((function(t){if(t!==n)return caches.delete(t)})))})))})),self.addEventListener("fetch",(function(t){var e=new URL(t.request.url);a.some((function(t){return e.pathname.includes(t)}))?t.respondWith(fetch(t.request)):t.respondWith(caches.match(t.request).then((function(e){return e||fetch(t.request).then((function(e){return caches.open(n).then((function(r){return r.put(t.request,e.clone()),e}))}))})).catch((function(){return caches.match(o)})))})),self.addEventListener("sync",(function(t){"background-sync"===t.tag&&t.waitUntil(function(){return c.apply(this,arguments)}())})),self.addEventListener("push",(function(t){var e=t.data.json();self.registration.showNotification(e.title,{body:e.body,icon:"images/static/icon/app_icon.webp"})})),self.addEventListener("notificationclick",(function(t){var e=t.notification;t.action;e.close()})),self.addEventListener("notificationclose",(function(t){var e=t.notification;console.log("Notification closed:",e)}))},547:()=>{},115:()=>{},969:()=>{}},t=>{var e=e=>t(t.s=e);t.O(0,[120,713,252],(()=>(e(687),e(547),e(115),e(969))));t.O()}]); //# sourceMappingURL=service-worker.js.map \ No newline at end of file diff --git a/public/service-worker.js.map b/public/service-worker.js.map index aaa312fc1..1be3cc3ff 100644 --- a/public/service-worker.js.map +++ b/public/service-worker.js.map @@ -1 +1 @@ -{"version":3,"file":"/service-worker.js","mappings":"odACAA,EAAA,kBAAAC,CAAA,MAAAC,EAAAD,EAAA,GAAAE,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAK,gBAAA,SAAAP,EAAAD,EAAAE,GAAAD,EAAAD,GAAAE,EAAAO,KAAA,EAAAC,EAAA,mBAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,EAAAjB,EAAAD,EAAAE,GAAA,OAAAC,OAAAK,eAAAP,EAAAD,EAAA,CAAAS,MAAAP,EAAAiB,YAAA,EAAAC,c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KAAKnB,GAAYnD,MAAK,SAACuE,GAC1B,OAAOA,EAAMC,OAAOnB,EACxB,IAER,IAGAU,KAAKC,iBAAiB,YAAY,SAACC,GAC/BA,EAAMG,UACFC,OAAOhC,OAAOrC,MAAK,SAACyE,GAChB,OAAOrC,QAAQsC,IACXD,EAAWE,KAAI,SAAC7C,GACZ,GAAIA,IAASqB,EACT,OAAOkB,OAAM,OAAQvC,EAE7B,IAER,IAER,IAGAiC,KAAKC,iBAAiB,SAAS,SAACC,GAC5BA,EAAMW,YACFP,OAAOQ,MAAMZ,EAAMa,SAAS9E,MAAK,SAAC+E,GAC9B,OAAOA,GAAYC,MAAMf,EAAMa,SAAS9E,MAAK,SAACiF,GAC1C,OAAOZ,OAAOC,KAAKnB,GAAYnD,MAAK,SAACuE,GAEjC,OADAA,EAAMW,IAAIjB,EAAMa,QAASG,EAAcE,SAChCF,CACX,GACJ,GACJ,IAAE,OAAO,WACL,OAAOZ,OAAOQ,MAAMzB,EACxB,IAER,IAGAW,KAAKC,iBAAiB,QAAQ,SAACC,GACT,oBAAdA,EAAMmB,KACNnB,EAAMG,UAEZ,WAE6B,OAAAd,EAAAM,MAAC,KAADD,UAAA,CAJP0B,GAExB,IAOAtB,KAAKC,iBAAiB,QAAQ,SAACC,GAC3B,IAAMC,EAAOD,EAAMC,KAAKoB,OAExBvB,KAAKwB,aAAaC,iBAAiBtB,EAAKuB,MAAO,CAC3CC,KAAMxB,EAAKwB,KACXC,KAAM,oCAEd,IAEA5B,KAAKC,iBAAiB,qBAAqB,SAACC,GAExC,IAAM2B,EAAe3B,EAAM2B,aACZ3B,EAAM4B,OAOrBD,EAAaE,OACjB,IAEA/B,KAAKC,iBAAiB,qBAAqB,SAACC,GACxC,IAAM8B,EAAwB9B,EAAM2B,aACpCnC,QAAQC,IAAI,uBAAwBqC,EACxC,G","sources":["webpack:///./resources/js/service-worker.js"],"sourcesContent":["importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox-sw.js')\n\nconst CACHE_VERSION = 'v1'\nconst CACHE_NAME = 'general-cache-' + CACHE_VERSION\nconst OFFLINE_URL = 'offline.html'\n\n// Cache important files by default\nconst defaultCaches = [\n OFFLINE_URL,\n 'css/app.css',\n 'css/chat.css',\n 'css/watch.css',\n 'js/app.js',\n 'js/vendor.js',\n 'js/db.js',\n 'js/chat.js',\n 'js/listen.js',\n 'js/watch.js',\n 'images/static/icon/app_icon.webp',\n]\n\nself.addEventListener(\"message\", (event) => {\n if (event.data && event.data.type === \"SKIP_WAITING\") {\n self.skipWaiting()\n }\n})\n\n// Open a cache and add the default files during installation\nself.addEventListener('install', (event) => {\n event.waitUntil(\n caches.open(CACHE_NAME).then((cache) => {\n return cache.addAll(defaultCaches)\n })\n )\n})\n\n// Activate the new service worker and clean up old caches\nself.addEventListener('activate', (event) => {\n event.waitUntil(\n caches.keys().then((cacheNames) => {\n return Promise.all(\n cacheNames.map((name) => {\n if (name !== CACHE_NAME) {\n return caches.delete(name)\n }\n })\n )\n })\n )\n})\n\n// Cache pages as the user browses\nself.addEventListener('fetch', (event) => {\n event.respondWith(\n caches.match(event.request).then((response) => {\n return response || fetch(event.request).then((fetchResponse) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, fetchResponse.clone())\n return fetchResponse\n })\n })\n }).catch(() => {\n return caches.match(OFFLINE_URL)\n })\n )\n})\n\n// Background Sync - periodic sync\nself.addEventListener('sync', (event) => {\n if (event.tag === 'background-sync') {\n event.waitUntil(doBackgroundSync())\n }\n})\n\nasync function doBackgroundSync() {\n console.log('Background sync is triggered!')\n}\n\n// Notifications API\nself.addEventListener('push', (event) => {\n const data = event.data.json();\n\n self.registration.showNotification(data.title, {\n body: data.body,\n icon: 'images/static/icon/app_icon.webp'\n });\n});\n\nself.addEventListener('notificationclick', (event) => {\n // Handle notification click event\n const notification = event.notification\n const action = event.action\n\n // if (action === 'open-url') {\n // // Open a specific URL when the notification is clicked\n // clients.openWindow('https://kurozora.app')\n // }\n\n notification.close()\n})\n\nself.addEventListener('notificationclose', (event) => {\n const dismissedNotification = event.notification\n console.log('Notification closed:', dismissedNotification)\n})\n"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","asyncGeneratorStep","importScripts","CACHE_NAME","OFFLINE_URL","defaultCaches","_doBackgroundSync","_callee","_context","console","log","arguments","apply","_next","_throw","self","addEventListener","event","data","skipWaiting","waitUntil","caches","open","cache","addAll","cacheNames","all","map","respondWith","match","request","response","fetch","fetchResponse","put","clone","tag","doBackgroundSync","json","registration","showNotification","title","body","icon","notification","action","close","dismissedNotification"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"/service-worker.js","mappings":"odACAA,EAAA,kBAAAC,CAAA,MAAAC,EAAAD,EAAA,GAAAE,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAK,gBAAA,SAAAP,EAAAD,EAAAE,GAAAD,EAAAD,GAAAE,EAAAO,KAAA,EAAAC,EAAA,mBAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,EAAAjB,EAAAD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,IAEAnC,KAAKC,iBAAiB,qBAAqB,SAACC,GAExC,IAAMkC,EAAelC,EAAMkC,aACZlC,EAAMmC,OAOrBD,EAAaE,OACjB,IAEAtC,KAAKC,iBAAiB,qBAAqB,SAACC,GACxC,IAAMqC,EAAwBrC,EAAMkC,aACpC1C,QAAQC,IAAI,uBAAwB4C,EACxC,G","sources":["webpack:///./resources/js/service-worker.js"],"sourcesContent":["importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox-sw.js')\n\nconst CACHE_VERSION = 'v1'\nconst CACHE_NAME = 'general-cache-' + CACHE_VERSION\nconst OFFLINE_URL = 'offline.html'\n\n// Cache important files by default\nconst defaultCaches = [\n OFFLINE_URL,\n 'css/app.css',\n 'css/chat.css',\n 'css/watch.css',\n 'js/app.js',\n 'js/vendor.js',\n 'js/db.js',\n 'js/chat.js',\n 'js/listen.js',\n 'js/watch.js',\n 'images/static/icon/app_icon.webp',\n]\n\n// Don't cache these endpoints\nconst noCacheEndpoints = [\n '/forgot-password',\n '/merge-library',\n '/reset-password',\n '/sign-in',\n '/sign-out',\n '/sign-up',\n '/siwa',\n '/two-factor-authentication'\n];\n\nself.addEventListener(\"message\", (event) => {\n if (event.data && event.data.type === \"SKIP_WAITING\") {\n self.skipWaiting()\n }\n})\n\n// Open a cache and add the default files during installation\nself.addEventListener('install', (event) => {\n event.waitUntil(\n caches.open(CACHE_NAME).then((cache) => {\n return cache.addAll(defaultCaches)\n })\n )\n})\n\n// Activate the new service worker and clean up old caches\nself.addEventListener('activate', (event) => {\n event.waitUntil(\n caches.keys().then((cacheNames) => {\n return Promise.all(\n cacheNames.map((name) => {\n if (name !== CACHE_NAME) {\n return caches.delete(name)\n }\n })\n )\n })\n )\n})\n\n// Cache pages as the user browses\nself.addEventListener('fetch', (event) => {\n const requestUrl = new URL(event.request.url);\n\n // Check if the request URL matches any endpoint that should not be cached\n if (noCacheEndpoints.some(endpoint => requestUrl.pathname.includes(endpoint))) {\n event.respondWith(fetch(event.request));\n } else {\n event.respondWith(\n caches.match(event.request).then((response) => {\n return response || fetch(event.request).then((fetchResponse) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, fetchResponse.clone())\n return fetchResponse\n })\n })\n }).catch(() => {\n return caches.match(OFFLINE_URL)\n })\n )\n }\n})\n\n// Background Sync - periodic sync\nself.addEventListener('sync', (event) => {\n if (event.tag === 'background-sync') {\n event.waitUntil(doBackgroundSync())\n }\n})\n\nasync function doBackgroundSync() {\n console.log('Background sync is triggered!')\n}\n\n// Notifications API\nself.addEventListener('push', (event) => {\n const data = event.data.json();\n\n self.registration.showNotification(data.title, {\n body: data.body,\n icon: 'images/static/icon/app_icon.webp'\n });\n});\n\nself.addEventListener('notificationclick', (event) => {\n // Handle notification click event\n const notification = event.notification\n const action = event.action\n\n // if (action === 'open-url') {\n // // Open a specific URL when the notification is clicked\n // clients.openWindow('https://kurozora.app')\n // }\n\n notification.close()\n})\n\nself.addEventListener('notificationclose', (event) => {\n const dismissedNotification = event.notification\n console.log('Notification closed:', dismissedNotification)\n})\n"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","asyncGeneratorStep","importScripts","CACHE_NAME","OFFLINE_URL","defaultCaches","noCacheEndpoints","_doBackgroundSync","_callee","_context","console","log","arguments","apply","_next","_throw","self","addEventListener","event","data","skipWaiting","waitUntil","caches","open","cache","addAll","cacheNames","all","map","requestUrl","URL","request","url","some","endpoint","pathname","includes","respondWith","fetch","match","response","fetchResponse","put","clone","tag","doBackgroundSync","json","registration","showNotification","title","body","icon","notification","action","close","dismissedNotification"],"sourceRoot":""} \ No newline at end of file diff --git a/resources/js/service-worker.js b/resources/js/service-worker.js index 122427f28..2a7bb215d 100644 --- a/resources/js/service-worker.js +++ b/resources/js/service-worker.js @@ -19,6 +19,18 @@ const defaultCaches = [ 'images/static/icon/app_icon.webp', ] +// Don't cache these endpoints +const noCacheEndpoints = [ + '/forgot-password', + '/merge-library', + '/reset-password', + '/sign-in', + '/sign-out', + '/sign-up', + '/siwa', + '/two-factor-authentication' +]; + self.addEventListener("message", (event) => { if (event.data && event.data.type === "SKIP_WAITING") { self.skipWaiting() @@ -51,18 +63,25 @@ self.addEventListener('activate', (event) => { // Cache pages as the user browses self.addEventListener('fetch', (event) => { - event.respondWith( - caches.match(event.request).then((response) => { - return response || fetch(event.request).then((fetchResponse) => { - return caches.open(CACHE_NAME).then((cache) => { - cache.put(event.request, fetchResponse.clone()) - return fetchResponse + const requestUrl = new URL(event.request.url); + + // Check if the request URL matches any endpoint that should not be cached + if (noCacheEndpoints.some(endpoint => requestUrl.pathname.includes(endpoint))) { + event.respondWith(fetch(event.request)); + } else { + event.respondWith( + caches.match(event.request).then((response) => { + return response || fetch(event.request).then((fetchResponse) => { + return caches.open(CACHE_NAME).then((cache) => { + cache.put(event.request, fetchResponse.clone()) + return fetchResponse + }) }) + }).catch(() => { + return caches.match(OFFLINE_URL) }) - }).catch(() => { - return caches.match(OFFLINE_URL) - }) - ) + ) + } }) // Background Sync - periodic sync