diff --git a/_config.butterfly.yml b/_config.butterfly.yml index f18345a1..88aee227 100644 --- a/_config.butterfly.yml +++ b/_config.butterfly.yml @@ -1077,11 +1077,12 @@ css_prefix: true # 插入代码到头部 之前 和 底部 之前 inject: head: - # - "" - - + - + # - "' + # - '
点击刷新 💫
' # - # - # - diff --git a/package-lock.json b/package-lock.json index 5d4e7e2d..1cca2a30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "hexo-server": "3.0.0", "hexo-tag-chart": "1.0.8", "hexo-tag-mmedia": "1.1.7", - "hexo-webpushr-notification": "0.1.2", + "hexo-webpushr-notification": "0.1.4", "hexo-wordcount": "6.0.1", "hexo-yam": "8.0.0", "markdown-it-task-lists": "2.1.1", @@ -35,29 +35,17 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, - "node_modules/@ampproject/remapping/node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", - "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/code-frame": { "version": "7.21.4", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", @@ -1701,9 +1689,9 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -1730,28 +1718,33 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dependencies": { "@jridgewell/resolve-uri": "3.1.0", "@jridgewell/sourcemap-codec": "1.4.14" } }, + "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -1865,9 +1858,9 @@ "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -2482,9 +2475,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001474", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz", - "integrity": "sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==", + "version": "1.0.30001481", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz", + "integrity": "sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==", "funding": [ { "type": "opencollective", @@ -2854,9 +2847,9 @@ "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js." }, "node_modules/core-js-compat": { - "version": "3.30.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.30.0.tgz", - "integrity": "sha512-P5A2h/9mRYZFIAP+5Ab8ns6083IyVpSclU74UNvbGVQ8VM7n3n3/g2yF3AkKQ9NXz2O+ioxLbEWKnDtgsFamhg==", + "version": "3.30.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.30.1.tgz", + "integrity": "sha512-d690npR7MC6P0gq4npTl5n2VQeNAmUrJ90n+MHiKS7W2+xno4o3F5GDEuylSdi6EJ3VssibSGXOa1r3YXD3Mhw==", "dependencies": { "browserslist": "^4.21.5" }, @@ -3196,9 +3189,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.350", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.350.tgz", - "integrity": "sha512-XnXcWpVnOfHZ4C3NPiL+SubeoGV8zc/pg8GEubRtc1dPA/9jKS2vsOPmtClJHhWxUb2RSGC1OBLCbgNUJMtZPw==" + "version": "1.4.369", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.369.tgz", + "integrity": "sha512-LfxbHXdA/S+qyoTEA4EbhxGjrxx7WK2h6yb5K2v0UCOufUKX+VZaHbl3svlzZfv9sGseym/g3Ne4DpsgRULmqg==" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -3217,9 +3210,9 @@ } }, "node_modules/entities": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", - "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "engines": { "node": ">=0.12" }, @@ -4217,9 +4210,9 @@ } }, "node_modules/hexo-front-matter": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/hexo-front-matter/-/hexo-front-matter-4.0.0.tgz", - "integrity": "sha512-2pQ24inDCdqbxuKQ4cK+1ak0AhSEVC1zTY/kVVyqi5m3lB/wYtAjSWp+elp+FqBmJOynogMpoBnUry/4fJkmAg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hexo-front-matter/-/hexo-front-matter-4.1.0.tgz", + "integrity": "sha512-8rac/v1WzD2qkIz3YmUuiV/2WhvzWaZbNA25yY8YsCD7PlR1XDND8jUDlvcCl01sVkZtzwnQT8JuWU4I2oM9jA==", "dependencies": { "js-yaml": "^4.1.0" }, @@ -5477,9 +5470,9 @@ } }, "node_modules/hexo-webpushr-notification": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/hexo-webpushr-notification/-/hexo-webpushr-notification-0.1.2.tgz", - "integrity": "sha512-9RJ0CwQJH2s7773ydjaw+WR9rzrmV1O7MGGGJ3jHZTzgAavZRod5dCRY6kDdYpUzsglr+ZNKhin+l205aSxkxw==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/hexo-webpushr-notification/-/hexo-webpushr-notification-0.1.4.tgz", + "integrity": "sha512-5J+yNaXQh6ToEHKY9Ys/YpNgA3fbFw+2R5Aema2Umec7V3vrYbf3wbndpR8ekqK9+ORq6rJ4PXpBPC7eU7KOZQ==", "dependencies": { "hexo-fs": "^4.1.1", "hexo-util": "^3.0.1", @@ -5762,9 +5755,9 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", + "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", "dependencies": { "has": "^1.0.3" }, @@ -7048,9 +7041,9 @@ } }, "node_modules/nunjucks": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.3.tgz", - "integrity": "sha512-psb6xjLj47+fE76JdZwskvwG4MYsQKXUtMsPh6U0YMvmyjRtKRFcxnlXGWglNybtNTNVmGdp94K62/+NjF5FDQ==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz", + "integrity": "sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ==", "dependencies": { "a-sync-waterfall": "^1.0.0", "asap": "^2.0.3", @@ -7818,13 +7811,13 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -7969,11 +7962,11 @@ } }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.11.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -8114,9 +8107,9 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -8890,9 +8883,9 @@ } }, "node_modules/terser": { - "version": "5.16.8", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.8.tgz", - "integrity": "sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.1.tgz", + "integrity": "sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw==", "dependencies": { "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", @@ -9371,9 +9364,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "funding": [ { "type": "opencollective", @@ -9382,6 +9375,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -9389,7 +9386,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" diff --git a/package.json b/package.json index 71988181..c3bd5b0b 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "hexo-server": "3.0.0", "hexo-tag-chart": "1.0.8", "hexo-tag-mmedia": "1.1.7", - "hexo-webpushr-notification": "0.1.2", + "hexo-webpushr-notification": "0.1.4", "hexo-wordcount": "6.0.1", "hexo-yam": "8.0.0", "markdown-it-task-lists": "2.1.1", diff --git a/source/privacy-policy/index.md b/source/privacy-policy/index.md index 57e2e30b..1aaf9f1b 100644 --- a/source/privacy-policy/index.md +++ b/source/privacy-policy/index.md @@ -4,7 +4,7 @@ top_img: false translate_title: privacy-policy subtitle: Privacy Policy date: 2021-05-14 17:12:24 -updated: 2023-04-04 22:22:00 +updated: 2023-04-22 21:18:00 description: CC的部落格 隐私政策 --- 本站非常重视用户的隐私和个人信息保护。您在使用网站时,可能会收集和使用您的相关信息。通过《隐私政策》向您说明在您访问 {% label blog.ccknbc.cc green %} 网站时,如何收集、使用、保存、共享和转让这些信息。由于本站性质为个人博客且为静态页面,暂未提供是否接受Cookies弹窗。即使我本人并不想搜集访客过多隐私信息,为了良好的浏览体验,默认启用全部功能,您可暂时使用隐私信息拦截插件去尽可能避免这种追踪。 @@ -34,14 +34,14 @@ description: CC的部落格 隐私政策 -| 类型
| 信息 | -|:-----------:|:-----------------------------------:| -| IP 地址 |
| -| 国家 |
| -| 省份 |
| -| 城市 |
| -| 运营商 |
| -| 设备 |
| +| 类型 | 信息 | +| :-----: | :-------------------------------: | +| IP 地址 |
| +| 国家 |
| +| 省份 |
| +| 城市 |
| +| 运营商 |
| +| 设备 |
| ## 如何使用 Cookies 和本地 LocalStorage 存储 @@ -99,4 +99,13 @@ Cookies提供许多功能。例如,他们可以帮助我记住您喜欢深色 我可能对此 Cookies 政策所做的任何更改都将发布在此页面上。如果更改很重要,我会在博客首页明确指出该政策已更新。 -{% btn '',最后修订时间:2023 年 4 月 24 日 22:22,fa-solid fa-history,block right green smaller %} +{% btn '',最后修订时间:2023 年 4 月 22 日 21:22,fa-solid fa-history,block right green smaller %} + + + + + + + + + diff --git a/themes/butterfly/layout/includes/head.pug b/themes/butterfly/layout/includes/head.pug index 045e5371..b4fc3557 100644 --- a/themes/butterfly/layout/includes/head.pug +++ b/themes/butterfly/layout/includes/head.pug @@ -22,7 +22,7 @@ meta(name="copyright" content=pageCopyright) meta(name ="format-detection" content="telephone=no") meta(name="theme-color" content=themeColor) if is_post() - meta(name="referrer" content="no-referrer") + //- meta(name="referrer" content="no-referrer") article(data-clarity-region="article") //- Open_Graph diff --git a/workbox-sw.js b/workbox-sw.js index bf4b49ed..9c957706 100644 --- a/workbox-sw.js +++ b/workbox-sw.js @@ -8,16 +8,30 @@ if (workbox) { } self.addEventListener("install", async () => { - console.log("Service Worker 开始安装"); + console.log("Service Worker 开始安装🎊"); await self.skipWaiting(); }); self.addEventListener("activate", async () => { - console.log("Service Worker 安装完成,开始启动"); + console.log("Service Worker 安装完成,开始启动✨"); await self.clients.claim(); }); -self.__WB_DISABLE_DEV_LOGS = false; +self.__WB_DISABLE_DEV_LOGS = true; + +// 解决防盗链问题 +self.addEventListener('fetch', event => { + const url = new URL(event.request.url) + const domain = url.hostname + if (domain === 'cdn.nlark.com' || domain === 'pic1.afdiancdn.com' || domain === 'f.video.weibocdn.com' || domain === 'api.icodeq.com') { + event.respondWith( + fetch(event.request, { + referrerPolicy: 'no-referrer' + + }) + ) + } +}) workbox.core.setCacheNameDetails({ prefix: "CC的部落格", @@ -126,23 +140,3 @@ workbox.routing.registerRoute( }) ); -// 离线谷歌分析 -// workbox.googleAnalytics.initialize(); - -// 拦截指定请求 -// self.addEventListener("fetch", async (event) => { -// console.log("运行中,拦截请求", event.request); -// const url = new URL(event.request.url); -// if ( -// url.pathname == "/favicon.ico" && -// url.searchParams.get("action") == "redirect" -// ) { -// // 拦截到后,处理业务再event.respondWith返回 -// request = new Request( -// "https://jsd.cdn.zzko.cn/gh/CCKNBC/ccknbc.github.io@master/favicon.ico" -// ); -// event.respondWith(fetch(request)); -// } else { -// event.respondWith(fetch(event.request)); -// } -// });