Skip to content

Commit ad64b37

Browse files
committedNov 8, 2023
update
1 parent 515b849 commit ad64b37

File tree

4 files changed

+42
-17
lines changed

4 files changed

+42
-17
lines changed
 

‎_locales/en/messages.json

+3
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@
505505
"permission_onedrive_cannot_revoke": {
506506
"message": "You must disable OneDrive backup first."
507507
},
508+
"permission_favicon": {
509+
"message": "Allows fetching website icons."
510+
},
508511
"permission_unknown_permission": {
509512
"message": "Unknown permission. If see this message, please send a bug report."
510513
}

‎sass/popup.scss

+21-7
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,6 @@ svg {
212212
display: none;
213213
}
214214

215-
.issuerFavicon {
216-
vertical-align: bottom;
217-
margin-right: 5px;
218-
height: 14px;
219-
width: 14px;
220-
}
221-
222215
&:hover {
223216
padding-right: 0;
224217
overflow-y: scroll;
@@ -318,12 +311,23 @@ svg {
318311

319312
.issuer {
320313
font-size: 12px;
314+
line-height: 16px;
315+
height: 16px;
321316
@include themify($themes) {
322317
color: themed("black-1");
323318
}
324319
width: 80%;
325320
text-overflow: ellipsis;
326321
overflow: hidden;
322+
323+
.issuerFavicon {
324+
vertical-align: bottom;
325+
margin-right: 5px;
326+
height: 16px;
327+
width: 16px;
328+
border-radius: 3px;
329+
border: 1px solid transparent;
330+
}
327331
}
328332

329333
.code {
@@ -1075,6 +1079,11 @@ svg {
10751079
color: #ccc;
10761080
}
10771081

1082+
.issuerFavicon {
1083+
background: white;
1084+
border: 1px solid white !important;
1085+
}
1086+
10781087
::-webkit-scrollbar {
10791088
background: #1e1e1e !important;
10801089
}
@@ -1207,6 +1216,11 @@ svg {
12071216
}
12081217
}
12091218

1219+
.issuerFavicon {
1220+
background: white;
1221+
border: 1px solid white !important;
1222+
}
1223+
12101224
.showqr,
12111225
.pin {
12121226
svg {

‎src/components/Popup/EntryComponent.vue

+8-10
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
<div class="issuer">
4242
<img
4343
class="issuerFavicon"
44-
v-if="shouldShowFavicon() && entry.issuer.split('::')[1]"
44+
v-if="shouldShowFavicon && entry.issuer.split('::')[1]"
4545
v-bind:src="getFaviconUrl(entry.issuer.split('::')[1])"
4646
/><IconMedal
4747
class="issuerFavicon"
48-
v-if="shouldShowFavicon() && !entry.issuer.split('::')[1]"
48+
v-if="shouldShowFavicon && !entry.issuer.split('::')[1]"
4949
/>
50-
{{
50+
{{
5151
entry.issuer.split("::")[0] +
5252
(theme === "compact" ? ` (${entry.account})` : "")
5353
}}
@@ -98,6 +98,7 @@ import { mapState } from "vuex";
9898
import * as QRGen from "qrcode-generator";
9999
import { OTPEntry, OTPType, CodeState, OTPAlgorithm } from "../../models/otp";
100100
import { EntryStorage } from "../../models/storage";
101+
import { isFirefox, isSafari } from "../../browser";
101102
102103
import IconMinusCircle from "../../../svg/minus-circle.svg";
103104
import IconRedo from "../../../svg/redo.svg";
@@ -118,7 +119,10 @@ const computedPrototype = [
118119
mapState("menu", ["theme"]),
119120
];
120121
121-
let computed = {};
122+
let computed: {} = {
123+
shouldShowFavicon:
124+
!isFirefox && !isSafari && mapState("menu", ["showFavicon"]).showFavicon,
125+
};
122126
123127
for (const module of computedPrototype) {
124128
Object.assign(computed, module);
@@ -146,12 +150,6 @@ export default Vue.extend({
146150
entry.type !== OTPType.steam
147151
);
148152
},
149-
shouldShowFavicon() {
150-
return (
151-
navigator.userAgent.indexOf("Firefox") === -1 &&
152-
this.$store.state.menu.showFavicon
153-
);
154-
},
155153
getFaviconUrl(u: string) {
156154
// TODO: Switch to commented out implementation when MV3
157155
// const url = new URL(chrome.runtime.getURL("/_favicon/"));

‎src/store/Permissions.ts

+10
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ const permissions: Permission[] = [
130130
},
131131
],
132132
},
133+
{
134+
id: "favicon",
135+
description: chrome.i18n.getMessage("permission_favicon"),
136+
revocable: true,
137+
},
138+
{
139+
id: "chrome://favicon/*",
140+
description: chrome.i18n.getMessage("permission_favicon"),
141+
revocable: true,
142+
},
133143
];
134144

135145
export class Permissions implements Module {

0 commit comments

Comments
 (0)
Failed to load comments.