Browse Source

remove google from source code

Simon Vieille 1 month ago
parent
commit
05156548ac
Signed by: Simon Vieille <simon@deblan.fr> GPG Key ID: 03383D15A1D31745
2 changed files with 658 additions and 3 deletions
  1. 582
    2
      index.html
  2. 76
    1
      sw.js

+ 582
- 2
index.html
File diff suppressed because it is too large
View File


+ 76
- 1
sw.js View File

@@ -1,2 +1,77 @@
1
-(function(){'use strict';async function a(a){const b=await caches.match(a);if(b)return b;const[c,d]=await Promise.all([fetch(a),caches.open(f)]);return d.put(a,c.clone()),c}let b=(()=>{function a(){return c||(c=new Promise((a,b)=>{const c=indexedDB.open('svgo-keyval',1);c.onerror=()=>{b(c.error)},c.onupgradeneeded=()=>{c.result.createObjectStore('keyval')},c.onsuccess=()=>{a(c.result)}})),c}async function b(b,c){const d=await a();return new Promise((a,e)=>{const f=d.transaction('keyval',b);f.oncomplete=()=>a(),f.onerror=()=>e(f.error),c(f.objectStore('keyval'))})}let c;return{async get(a){let c;return await b('readonly',(b)=>{c=b.get(a)}),c.result},set(a,c){return b('readwrite',(b)=>{b.put(c,a)})},delete(a){return b('readwrite',(b)=>{b.delete(a)})}}})();self.indexedDB||(b={get:(a)=>Promise.resolve(localStorage.getItem(a)),set:(a,b)=>Promise.resolve(localStorage.setItem(a,b)),delete:(a)=>Promise.resolve(localStorage.removeItem(a))});const c='1.12.0',d='svgomg-',e=`${d}static-${c}`,f=`${d}fonts`,g=[e,f];addEventListener('install',(a)=>{a.waitUntil((async()=>{const a=b.get('active-version'),d=await caches.open(e);await d.addAll(['./','imgs/icon.png','css/all.css','js/gzip-worker.js','js/page.js','js/prism-worker.js','js/svgo-worker.js','changelog.json','https://fonts.googleapis.com/css?family=Roboto:400,700|Inconsolata']);const f=await a;f&&f.split('.')[0]!==c.split('.')[0]||self.skipWaiting()})())}),addEventListener('activate',(a)=>{a.waitUntil((async()=>{for(const a of await caches.keys())a.startsWith(d)&&(g.includes(a)||(await caches.delete(a)));await b.set('active-version',c)})())}),addEventListener('fetch',(b)=>{const c=new URL(b.request.url);return'fonts.gstatic.com'==c.host?void b.respondWith(a(b.request)):void b.respondWith(caches.match(b.request).then((a)=>a||fetch(b.request)))})})();
1
+(function() {
2
+    'use strict';
3
+    async
4
+    function a(a) {
5
+        const b = await caches.match(a);
6
+        if (b) return b;
7
+        const [c, d] = await Promise.all([fetch(a), caches.open(f)]);
8
+        return d.put(a, c.clone()), c
9
+    }
10
+    let b = (() => {
11
+        function a() {
12
+            return c || (c = new Promise((a, b) => {
13
+                const c = indexedDB.open('svgo-keyval', 1);
14
+                c.onerror = () => {
15
+                    b(c.error)
16
+                }, c.onupgradeneeded = () => {
17
+                    c.result.createObjectStore('keyval')
18
+                }, c.onsuccess = () => {
19
+                    a(c.result)
20
+                }
21
+            })), c
22
+        }
23
+        async
24
+        function b(b, c) {
25
+            const d = await a();
26
+            return new Promise((a, e) => {
27
+                const f = d.transaction('keyval', b);
28
+                f.oncomplete = () => a(), f.onerror = () => e(f.error), c(f.objectStore('keyval'))
29
+            })
30
+        }
31
+        let c;
32
+        return {
33
+            async get(a) {
34
+                let c;
35
+                return await b('readonly', (b) => {
36
+                    c = b.get(a)
37
+                }), c.result
38
+            }, set(a, c) {
39
+                return b('readwrite', (b) => {
40
+                    b.put(c, a)
41
+                })
42
+            }, delete(a) {
43
+                return b('readwrite', (b) => {
44
+                    b.delete(a)
45
+                })
46
+            }
47
+        }
48
+    })();
49
+    self.indexedDB || (b = {
50
+        get: (a) => Promise.resolve(localStorage.getItem(a)),
51
+        set: (a, b) => Promise.resolve(localStorage.setItem(a, b)),
52
+        delete: (a) => Promise.resolve(localStorage.removeItem(a))
53
+    });
54
+    const c = '1.12.0',
55
+        d = 'svgomg-',
56
+        e = `${d}static-${c}`,
57
+        f = `${d}fonts`,
58
+        g = [e, f];
59
+    addEventListener('install', (a) => {
60
+        a.waitUntil((async() => {
61
+            const a = b.get('active-version'),
62
+                d = await caches.open(e);
63
+            await d.addAll(['./', 'imgs/icon.png', 'css/all.css', 'js/gzip-worker.js', 'js/page.js', 'js/prism-worker.js', 'js/svgo-worker.js', 'changelog.json']);
64
+            const f = await a;
65
+            f && f.split('.')[0] !== c.split('.')[0] || self.skipWaiting()
66
+        })())
67
+    }), addEventListener('activate', (a) => {
68
+        a.waitUntil((async() => {
69
+            for (const a of await caches.keys()) a.startsWith(d) && (g.includes(a) || (await caches.delete(a)));
70
+            await b.set('active-version', c)
71
+        })())
72
+    }), addEventListener('fetch', (b) => {
73
+        const c = new URL(b.request.url);
74
+        return 'fonts.gstatic.com' == c.host ? void b.respondWith(a(b.request)) : void b.respondWith(caches.match(b.request).then((a) => a || fetch(b.request)))
75
+    })
76
+})();
2 77
 //# sourceMappingURL=sw.js.map

Loading…
Cancel
Save