Imgflip Logo Icon

Disgusted

Disgusted | , CACHE_MAX_ENTRIES = 500
  , FILES_TO_PRECACHE = ["/imgflip_white_96.png", "/imgflip-icon-transparent-192.svg", "/offline", "/imgflip-icon-padded-192.svg"];
self.addEventListener("install", function(a) {
    self.skipWaiting && self.skipWaiting();
    a.waitUntil(caches.open(CACHE_NAME).then(function(b) {
        return b.addAll(FILES_TO_PRECACHE)
    }))
});
self.addEventListener("activate", function(a) {
    var b = [CACHE_NAME];
    a.waitUntil(caches.keys().then(function(c) {
        return Promise.all(c.map(function(d) {
            if (-1 === b.indexOf(d))
                return caches["delete"](d)
        }))
    }))
});
self.addEventListener("fetch", function(a) {
    if ("POST" !== a.request.method && a.request.url.match(/^https:\/\/([a-z]+\.)?imgflip\.com(\/|$)/)) {
        if ("function" === typeof URL) {
            var b = new URL(a.request.url);
            if (b.pathname && -1 !== FILES_TO_PRECACHE.indexOf(b.pathname) && "." === b.pathname.substr(-4, 1)) {
                a.respondWith(caches.match(a.request).then(function(c) {
                    return c ? c : fetchAndCache(a.request)
                }));
                return
            }
        }
        a.request.url.match(/\.(js|css|png|gif|jpg|ico|svg|mp4|webm)/) || a.respondWith(fetchAndCache(a.request)["catch"](function() {
            return caches.match(a.request).then(function(c) {
                if (c)
                    return c;
                if ("navigate" === a.request.mode)
                    return caches.open(CACHE_NAME).then(function(d) {
                        return d.match("offline")
                    })
            })
        }))
    }
});
function fetchAndCache(a) {
    return fetch(a).then(function(b) {
        if (!b || 200 !== b.status || "basic" !== b.type)
            return b;
        var c = b.clone();
        caches.open(CACHE_NAME).then(function(d) {
            d.put(a, c)
        });
        return b
    })
}
self.addEventListener("message", function(a) {
    "cache_clear_old_entries" === a.data && caches.open(CACHE_NAME).then(function(b) {
        b.keys().then(function(c) {
            var d = c.length - CACHE_MAX_ENTRIES;
            if (!(1 > d))
                for (var e = 0; e < d; e++) {
                    var f = new URL(c[e].url);
                    -1 === FILES_TO_PRECACHE.indexOf(f.pathname) && b["delete"](c[e])
                }
        })
    })
});
self.addEventListener("notificationclick", function(a) {
    "memechat" === a.notification.tag && a.waitUntil(clients.matchAll({
        includeUncontrolled: !0
    }).then(function(b) {
        for (var c = 0; c < b.length; c++) {
            var d = b[c];
            if ("/memechat" === (new URL(d.url)).pathname.substr(0, 9) && "focus"in d)
                return d.focus()
        }
        if (clients.openWindow)
            return clients.openWindow("/memechat")
    }))
}); | image tagged in disgusted | made w/ Imgflip meme maker
56 views 2 upvotes Made by anonymous 10 months ago in MS_memer_group
Disgusted memeCaption this Meme
4 Comments
[deleted] M
1 up, 10mo,
1 reply
, CACHE_MAX_ENTRIES = 500
, FILES_TO_PRECACHE = ["/imgflip_white_96.png", "/imgflip-icon-transparent-192.svg", "/offline", "/imgflip-icon-padded-192.svg"];
self.addEventListener("install", function(a) {
self.skipWaiting && self.skipWaiting();
a.waitUntil(caches.open(CACHE_NAME).then(function(b) {
return b.addAll(FILES_TO_PRECACHE)
}))
});
self.addEventListener("activate", function(a) {
var b = [CACHE_NAME];
a.waitUntil(caches.keys().then(function(c) {
return Promise.all(c.map(function(d) {
if (-1 === b.indexOf(d))
return caches["delete"](d)
}))
}))
});
self.addEventListener("fetch", function(a) {
if ("POST" !== a.request.method && a.request.url.match(/^https:\/\/([a-z]+\.)?imgflip\.com(\/|$)/)) {
if ("function" === typeof URL) {
var b = new URL(a.request.url);
if (b.pathname && -1 !== FILES_TO_PRECACHE.indexOf(b.pathname) && "." === b.pathname.substr(-4, 1)) {
a.respondWith(caches.match(a.request).then(function(c) {
return c ? c : fetchAndCache(a.request)
}));
return
}
}
a.request.url.match(/\.(js|css|png|gif|jpg|ico|svg|mp4|webm)/) || a.respondWith(fetchAndCache(a.request)["catch"](function() {
return caches.match(a.request).then(function(c) {
if (c)
return c;
if ("navigate" === a.request.mode)
return caches.open(CACHE_NAME).then(function(d) {
return d.match("offline")
})
})
}))
}
});
function fetchAndCache(a) {
return fetch(a).then(function(b) {
if (!b || 200 !== b.status || "basic" !== b.type)
return b;
var c = b.clone();
caches.open(CACHE_NAME).then(function(d) {
d.put(a, c)
});
return b
})
}
self.addEventListener("message", function(a) {
"cache_clear_old_entries" === a.data && caches.open(CACHE_NAME).then(function(b) {
b.keys().then(function(c) {
var d = c.length - CACHE_MAX_ENTRIES;
if (!(1 > d))
for (var e = 0; e < d; e++) {
var f = new URL(c[e].url);
-1 === FILES_TO_PRECACHE.indexOf(f.pathname) && b["delete"](c[e])
}
})
})
});
self.addEventListener("notificationclick", function(a) {
"memechat" === a
1 up, 10mo
so true
0 ups, 10mo,
1 reply
DONT CHECK THE SLIDES!! PLEASE!!!
[deleted] M
0 ups, 10mo
TF
Disgusted memeCaption this Meme
Created with the Imgflip Meme Generator
IMAGE DESCRIPTION:
, CACHE_MAX_ENTRIES = 500 , FILES_TO_PRECACHE = ["/imgflip_white_96.png", "/imgflip-icon-transparent-192.svg", "/offline", "/imgflip-icon-padded-192.svg"]; self.addEventListener("install", function(a) { self.skipWaiting && self.skipWaiting(); a.waitUntil(caches.open(CACHE_NAME).then(function(b) { return b.addAll(FILES_TO_PRECACHE) })) }); self.addEventListener("activate", function(a) { var b = [CACHE_NAME]; a.waitUntil(caches.keys().then(function(c) { return Promise.all(c.map(function(d) { if (-1 === b.indexOf(d)) return caches["delete"](d) })) })) }); self.addEventListener("fetch", function(a) { if ("POST" !== a.request.method && a.request.url.match(/^https:\/\/([a-z]+\.)?imgflip\.com(\/|$)/)) { if ("function" === typeof URL) { var b = new URL(a.request.url); if (b.pathname && -1 !== FILES_TO_PRECACHE.indexOf(b.pathname) && "." === b.pathname.substr(-4, 1)) { a.respondWith(caches.match(a.request).then(function(c) { return c ? c : fetchAndCache(a.request) })); return } } a.request.url.match(/\.(js|css|png|gif|jpg|ico|svg|mp4|webm)/) || a.respondWith(fetchAndCache(a.request)["catch"](function() { return caches.match(a.request).then(function(c) { if (c) return c; if ("navigate" === a.request.mode) return caches.open(CACHE_NAME).then(function(d) { return d.match("offline") }) }) })) } }); function fetchAndCache(a) { return fetch(a).then(function(b) { if (!b || 200 !== b.status || "basic" !== b.type) return b; var c = b.clone(); caches.open(CACHE_NAME).then(function(d) { d.put(a, c) }); return b }) } self.addEventListener("message", function(a) { "cache_clear_old_entries" === a.data && caches.open(CACHE_NAME).then(function(b) { b.keys().then(function(c) { var d = c.length - CACHE_MAX_ENTRIES; if (!(1 > d)) for (var e = 0; e < d; e++) { var f = new URL(c[e].url); -1 === FILES_TO_PRECACHE.indexOf(f.pathname) && b["delete"](c[e]) } }) }) }); self.addEventListener("notificationclick", function(a) { "memechat" === a.notification.tag && a.waitUntil(clients.matchAll({ includeUncontrolled: !0 }).then(function(b) { for (var c = 0; c < b.length; c++) { var d = b[c]; if ("/memechat" === (new URL(d.url)).pathname.substr(0, 9) && "focus"in d) return d.focus() } if (clients.openWindow) return clients.openWindow("/memechat") })) });