From 5e8f2739de1355f771df7d00f19ee676b5bf0d7b Mon Sep 17 00:00:00 2001 From: yoyurec Date: Thu, 9 Mar 2023 13:55:20 +0200 Subject: [PATCH] fix(favicons): add missed file protocol --- package.json | 4 +- pnpm-lock.yaml | 80 ++++++++++++++++---------------- src/modules/favIcons/favIcons.ts | 10 ++-- 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index d019ab3..028887f 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", "@semantic-release/npm": "^9.0.2", - "@typescript-eslint/eslint-plugin": "^5.54.0", - "@typescript-eslint/parser": "^5.54.0", + "@typescript-eslint/eslint-plugin": "^5.54.1", + "@typescript-eslint/parser": "^5.54.1", "conventional-changelog-conventionalcommits": "^5.0.0", "cz-conventional-changelog": "3.3.0", "eslint": "^8.35.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0422b38..34c89f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ specifiers: '@semantic-release/exec': ^6.0.3 '@semantic-release/git': ^10.0.1 '@semantic-release/npm': ^9.0.2 - '@typescript-eslint/eslint-plugin': ^5.54.0 - '@typescript-eslint/parser': ^5.54.0 + '@typescript-eslint/eslint-plugin': ^5.54.1 + '@typescript-eslint/parser': ^5.54.1 color2k: ^2.0.2 conventional-changelog-conventionalcommits: ^5.0.0 cz-conventional-changelog: 3.3.0 @@ -27,8 +27,8 @@ devDependencies: '@semantic-release/exec': 6.0.3_semantic-release@19.0.5 '@semantic-release/git': 10.0.1_semantic-release@19.0.5 '@semantic-release/npm': 9.0.2_semantic-release@20.1.1 - '@typescript-eslint/eslint-plugin': 5.54.0_6mj2wypvdnknez7kws2nfdgupi - '@typescript-eslint/parser': 5.54.0_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/eslint-plugin': 5.54.1_mlk7dnz565t663n4razh6a6v6i + '@typescript-eslint/parser': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu conventional-changelog-conventionalcommits: 5.0.0 cz-conventional-changelog: 3.3.0 eslint: 8.35.0 @@ -961,8 +961,8 @@ packages: resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} dev: true - /@typescript-eslint/eslint-plugin/5.54.0_6mj2wypvdnknez7kws2nfdgupi: - resolution: {integrity: sha512-+hSN9BdSr629RF02d7mMtXhAJvDTyCbprNYJKrXETlul/Aml6YZwd90XioVbjejQeHbb3R8Dg0CkRgoJDxo8aw==} + /@typescript-eslint/eslint-plugin/5.54.1_mlk7dnz565t663n4razh6a6v6i: + resolution: {integrity: sha512-a2RQAkosH3d3ZIV08s3DcL/mcGc2M/UC528VkPULFxR9VnVPT8pBu0IyBAJJmVsCmhVfwQX1v6q+QGnmSe1bew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -972,10 +972,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.54.0_ycpbpc6yetojsgtrx3mwntkhsu - '@typescript-eslint/scope-manager': 5.54.0 - '@typescript-eslint/type-utils': 5.54.0_ycpbpc6yetojsgtrx3mwntkhsu - '@typescript-eslint/utils': 5.54.0_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/parser': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/scope-manager': 5.54.1 + '@typescript-eslint/type-utils': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/utils': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu debug: 4.3.4 eslint: 8.35.0 grapheme-splitter: 1.0.4 @@ -989,8 +989,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.54.0_ycpbpc6yetojsgtrx3mwntkhsu: - resolution: {integrity: sha512-aAVL3Mu2qTi+h/r04WI/5PfNWvO6pdhpeMRWk9R7rEV4mwJNzoWf5CCU5vDKBsPIFQFjEq1xg7XBI2rjiMXQbQ==} + /@typescript-eslint/parser/5.54.1_ycpbpc6yetojsgtrx3mwntkhsu: + resolution: {integrity: sha512-8zaIXJp/nG9Ff9vQNh7TI+C3nA6q6iIsGJ4B4L6MhZ7mHnTMR4YP5vp2xydmFXIy8rpyIVbNAG44871LMt6ujg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -999,9 +999,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.54.0 - '@typescript-eslint/types': 5.54.0 - '@typescript-eslint/typescript-estree': 5.54.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.54.1 + '@typescript-eslint/types': 5.54.1 + '@typescript-eslint/typescript-estree': 5.54.1_typescript@4.9.5 debug: 4.3.4 eslint: 8.35.0 typescript: 4.9.5 @@ -1009,16 +1009,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.54.0: - resolution: {integrity: sha512-VTPYNZ7vaWtYna9M4oD42zENOBrb+ZYyCNdFs949GcN8Miwn37b8b7eMj+EZaq7VK9fx0Jd+JhmkhjFhvnovhg==} + /@typescript-eslint/scope-manager/5.54.1: + resolution: {integrity: sha512-zWKuGliXxvuxyM71UA/EcPxaviw39dB2504LqAmFDjmkpO8qNLHcmzlh6pbHs1h/7YQ9bnsO8CCcYCSA8sykUg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.54.0 - '@typescript-eslint/visitor-keys': 5.54.0 + '@typescript-eslint/types': 5.54.1 + '@typescript-eslint/visitor-keys': 5.54.1 dev: true - /@typescript-eslint/type-utils/5.54.0_ycpbpc6yetojsgtrx3mwntkhsu: - resolution: {integrity: sha512-WI+WMJ8+oS+LyflqsD4nlXMsVdzTMYTxl16myXPaCXnSgc7LWwMsjxQFZCK/rVmTZ3FN71Ct78ehO9bRC7erYQ==} + /@typescript-eslint/type-utils/5.54.1_ycpbpc6yetojsgtrx3mwntkhsu: + resolution: {integrity: sha512-WREHsTz0GqVYLIbzIZYbmUUr95DKEKIXZNH57W3s+4bVnuF1TKe2jH8ZNH8rO1CeMY3U4j4UQeqPNkHMiGem3g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -1027,8 +1027,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.54.0_typescript@4.9.5 - '@typescript-eslint/utils': 5.54.0_ycpbpc6yetojsgtrx3mwntkhsu + '@typescript-eslint/typescript-estree': 5.54.1_typescript@4.9.5 + '@typescript-eslint/utils': 5.54.1_ycpbpc6yetojsgtrx3mwntkhsu debug: 4.3.4 eslint: 8.35.0 tsutils: 3.21.0_typescript@4.9.5 @@ -1037,13 +1037,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.54.0: - resolution: {integrity: sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ==} + /@typescript-eslint/types/5.54.1: + resolution: {integrity: sha512-G9+1vVazrfAfbtmCapJX8jRo2E4MDXxgm/IMOF4oGh3kq7XuK3JRkOg6y2Qu1VsTRmWETyTkWt1wxy7X7/yLkw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.54.0_typescript@4.9.5: - resolution: {integrity: sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ==} + /@typescript-eslint/typescript-estree/5.54.1_typescript@4.9.5: + resolution: {integrity: sha512-bjK5t+S6ffHnVwA0qRPTZrxKSaFYocwFIkZx5k7pvWfsB1I57pO/0M0Skatzzw1sCkjJ83AfGTL0oFIFiDX3bg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -1051,8 +1051,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.54.0 - '@typescript-eslint/visitor-keys': 5.54.0 + '@typescript-eslint/types': 5.54.1 + '@typescript-eslint/visitor-keys': 5.54.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1063,17 +1063,17 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.54.0_ycpbpc6yetojsgtrx3mwntkhsu: - resolution: {integrity: sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw==} + /@typescript-eslint/utils/5.54.1_ycpbpc6yetojsgtrx3mwntkhsu: + resolution: {integrity: sha512-IY5dyQM8XD1zfDe5X8jegX6r2EVU5o/WJnLu/znLPWCBF7KNGC+adacXnt5jEYS9JixDcoccI6CvE4RCjHMzCQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.54.0 - '@typescript-eslint/types': 5.54.0 - '@typescript-eslint/typescript-estree': 5.54.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.54.1 + '@typescript-eslint/types': 5.54.1 + '@typescript-eslint/typescript-estree': 5.54.1_typescript@4.9.5 eslint: 8.35.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.35.0 @@ -1083,11 +1083,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys/5.54.0: - resolution: {integrity: sha512-xu4wT7aRCakGINTLGeyGqDn+78BwFlggwBjnHa1ar/KaGagnmwLYmlrXIrgAaQ3AE1Vd6nLfKASm7LrFHNbKGA==} + /@typescript-eslint/visitor-keys/5.54.1: + resolution: {integrity: sha512-q8iSoHTgwCfgcRJ2l2x+xCbu8nBlRAlsQ33k24Adj8eoVBE0f8dUeI+bAa8F84Mv05UGbAx57g2zrRsYIooqQg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.54.0 + '@typescript-eslint/types': 5.54.1 eslint-visitor-keys: 3.3.0 dev: true @@ -2378,7 +2378,7 @@ packages: resolution: {integrity: sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - lru-cache: 7.18.1 + lru-cache: 7.18.3 dev: true /http-proxy-agent/5.0.0: @@ -2805,8 +2805,8 @@ packages: yallist: 4.0.0 dev: true - /lru-cache/7.18.1: - resolution: {integrity: sha512-8/HcIENyQnfUTCDizRu9rrDyG6XG/21M4X7/YEGZeD76ZJilFPAUVb/2zysFf7VVO1LEjCDFyHp8pMMvozIrvg==} + /lru-cache/7.18.3: + resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} dev: true diff --git a/src/modules/favIcons/favIcons.ts b/src/modules/favIcons/favIcons.ts index ccf919a..26fdd14 100644 --- a/src/modules/favIcons/favIcons.ts +++ b/src/modules/favIcons/favIcons.ts @@ -89,6 +89,13 @@ const getFaviconData = async (url: string): Promise => { src: await getBase64FromUrl(`https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://logseq.com&size=32`) }; } + // local + if (protocol === 'file:') { + return favIcon = { + format: 'svg', + src: '' + }; + } // http - custom if (hostname === 'youtu.be') { return favIcon = { @@ -232,7 +239,4 @@ export const faviconsLoad = async () => { export const faviconsUnload = () => { globals.favIconsCache.clear(); removeFavicons(); - // if (!globalContext.pluginConfig.pageIconsEnabled && !globalContext.pluginConfig.faviconsEnabled) { - // stopLinksObserver(); - // } }