Compare commits

..

No commits in common. "master" and "v1.11.2" have entirely different histories.

1 changed files with 1 additions and 8 deletions

View File

@ -151,14 +151,7 @@ const updateCache = request => new Promise((resolve, reject) => {
// 2. If cache is not available: Fetch from network and update cache. // 2. If cache is not available: Fetch from network and update cache.
// This way, cached files are only updated if the cacheVersion is changed // This way, cached files are only updated if the cacheVersion is changed
self.addEventListener('fetch', function(event) { self.addEventListener('fetch', function(event) {
const swOrigin = new URL(self.location.href).origin; if (event.request.method === "POST") {
const requestOrigin = new URL(event.request.url).origin;
if (swOrigin !== requestOrigin) {
// Do not handle requests from other origin
event.respondWith(fetch(event.request));
}
else if (event.request.method === "POST") {
// Requests related to Web Share Target. // Requests related to Web Share Target.
event.respondWith((async () => { event.respondWith((async () => {
const share_url = await evaluateRequestData(event.request); const share_url = await evaluateRequestData(event.request);