File tree Expand file tree Collapse file tree 6 files changed +20
-10
lines changed
Expand file tree Collapse file tree 6 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 4646
4747.url-list li span {
4848 font-weight : 600 ;
49+ margin-left : 10px ;
4950}
5051
5152input [type = 'text' ] {
Original file line number Diff line number Diff line change 11<template >
22 <div class =" container" >
3- <img v-if =" faviconValid " class =" favicon no-favicon" height =" 22" :src =" NO_FAVICON" />
4- <img v-else class =" favicon" height =" 30" :src =" faviconUrl " />
3+ <img v-if =" faviconNotValid " class =" favicon no-favicon" height =" 22" :src =" NO_FAVICON" />
4+ <img v-else class =" favicon" height =" 30" :src =" favicon " />
55 </div >
66</template >
77
@@ -17,15 +17,17 @@ import { NO_FAVICON } from '../utils/consts';
1717import { TypeOfUrl } from ' ../utils/enums' ;
1818
1919const props = defineProps <{
20- url : string ;
20+ favicon : string | undefined ;
2121 type: TypeOfUrl ;
2222}>();
2323
24- const faviconValid = computed (
25- () => props .url .startsWith (' chrome://favicon/' ) || props .type == TypeOfUrl .Document ,
24+ const faviconNotValid = computed (
25+ () =>
26+ props .favicon == undefined ||
27+ props .favicon == ' ' ||
28+ props .favicon .startsWith (' chrome://favicon/' ) ||
29+ props .type == TypeOfUrl .Document ,
2630);
27-
28- const faviconUrl = computed (() => ` https://www.google.com/s2/favicons?domain=${props .url }&sz=64 ` );
2931 </script >
3032
3133<style scoped>
Original file line number Diff line number Diff line change 88 height =" 16"
99 @click =" editItemFromList(limit.domain, limit.time)"
1010 />
11- <Favicon :url =" limit.domain" :type =" TypeOfUrl.WebSite" /> <span >{{ limit.domain }}</span >
11+ <Favicon :type =" TypeOfUrl.WebSite" :favicon =" getFavicon(limit.domain)" />
12+ <span >{{ limit.domain }}</span >
1213 <p class =" time-value" >{{ t('limit.message') }} : {{ getTime(limit.time) }}</p >
1314 </div >
1415 </li >
@@ -40,6 +41,7 @@ export default {
4041
4142<script lang="ts" setup>
4243import Favicon from ' ./Favicon.vue' ;
44+ import { getFavicon } from ' ../utils/favicon' ;
4345import { useNotification } from ' @kyvg/vue3-notification' ;
4446import { useI18n } from ' vue-i18n' ;
4547import { injecStorage } from ' ../storage/inject-storage' ;
Original file line number Diff line number Diff line change 11<template >
22 <div class =" tab-item" >
3- <Favicon :url =" item.url " :type =" typeOfUrl" />
3+ <Favicon :favicon =" item.favicon " :type =" typeOfUrl" />
44 <div class =" ml-10 flex-grow-2" >
55 <div class =" first-block" >
66 <div :class =" listType == TypeOfList.All ? 'w-60' : 'w-80'" >
Original file line number Diff line number Diff line change 55 <li v-for =" (url, i) of whiteList" :key =" i" >
66 <div >
77 <img src =" ../assets/icons/delete.png" height =" 16" @click =" deleteFromWhiteList(url)" />
8- <Favicon :url =" url" :type =" TypeOfUrl.WebSite" /> <span >{{ url }}</span >
8+ <Favicon :type =" TypeOfUrl.WebSite" :favicon =" getFavicon(url)" />
9+ <span >{{ url }}</span >
910 </div >
1011 </li >
1112 </ul >
@@ -35,6 +36,7 @@ export default {
3536
3637<script lang="ts" setup>
3738import Favicon from ' ./Favicon.vue' ;
39+ import { getFavicon } from ' ../utils/favicon' ;
3840import { onMounted , ref } from ' vue' ;
3941import { useI18n } from ' vue-i18n' ;
4042import { TypeOfUrl } from ' ../utils/enums' ;
Original file line number Diff line number Diff line change 1+ export function getFavicon ( url : string ) {
2+ return `https://www.google.com/s2/favicons?domain=${ url } &sz=64` ;
3+ }
You can’t perform that action at this time.
0 commit comments