Skip to content

Commit 47c079a

Browse files
committed
Track chrome pages & fix locales
1 parent ab109d6 commit 47c079a

File tree

8 files changed

+40
-22
lines changed

8 files changed

+40
-22
lines changed

src/_locales/de/messages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
},
131131
"viewTimeInBadge": {
132132
"message": "Zeitindikator anzeigen",
133-
"description": "Sie können die aktuellen Informationen zur verbrauchten Zeit im Kurzformat auf dem Erweiterungssymbol anzeigen"
133+
"description": "Sie können die aktuellen Informationen zur \"verbrauchten Zeit\" im Kurzformat anzeigen"
134134
},
135135
"deferringDescription": {
136136
"message": "Sie können die Sperre nur einmal während des Tages um 5 Minuten verschieben"
@@ -194,7 +194,7 @@
194194
"description": "Dieser Text wird in der Benachrichtigung für Websites angezeigt"
195195
},
196196
"notificationTimeSetting": {
197-
"message": "Zeigt eine Benachrichtigung an, die eine Zusammenfassung Ihrer täglichen Nutzung enthält"
197+
"message": "Benachrichtigungszeit mit zusammenfassenden Informationen zur täglichen Nutzung"
198198
},
199199
"github": {
200200
"message": "Wenn Sie eine Frage haben oder ein Problem melden möchten, können Sie dies tun"

src/_locales/en/messages.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@
137137
},
138138
"allowDeferringBlock": {
139139
"message": "Allow deferring block for 5 minutes",
140-
"description": "After the site is blocked, you can postpone the blocking for 5 minutes once during the day"
140+
"description": "After the site is blocked, you can postpone the blocking for 5 minutes during the day only once"
141141
},
142142
"intervalInactivity": {
143-
"message": "Stop the tracker if there is no action during:",
143+
"message": "Stop the tracker if there is no action for",
144144
"description": "These are any actions with the mouse or keyboard"
145145
},
146146
"exportToCsvSetting": {
@@ -172,8 +172,8 @@
172172
"message": "Enter notification message..."
173173
},
174174
"limits": {
175-
"message": "Daily restrictions on access to websites",
176-
"description": "Set the maximum time allowed to visit the site per day. After this time, the site will be blocked."
175+
"message": "Daily access restrictions for the websites",
176+
"description": "Set the maximum time allowed to visit the website per day. After this time, the site will be blocked."
177177
},
178178
"limitsTip": {
179179
"message": "If you set the blocking time to 0 hours 0 minutes, the website will be blocked immediately"
@@ -197,28 +197,28 @@
197197
"message": "Notification time with summary information about your daily usage"
198198
},
199199
"github": {
200-
"message": "If you have feedback or would like to report an issue, you can do so on the"
200+
"message": "Leave your feedback or report an issue on "
201201
},
202202
"question": {
203-
"message": "You can also ask questions or leave your suggestions here"
203+
"message": "You can also ask questions and leave your suggestions"
204204
},
205205
"supportForm": {
206206
"message": "support form"
207207
},
208208
"doYouEnjoy": {
209-
"message": "Do you enjoy using Web Activity Time Tracker?"
209+
"message": "Do you enjoy Web Activity Time Tracker?"
210210
},
211211
"review": {
212212
"message": "Leave a review!"
213213
},
214214
"block": {
215-
"message": "You've reached your limit today on "
215+
"message": "You've reached your limit for today on "
216216
},
217217
"5mins": {
218218
"message": "+ 5 minutes"
219219
},
220220
"todayUsageTime": {
221-
"message": "Today's total usage time "
221+
"message": "Total usage time for today "
222222
},
223223
"comparedToYesterday": {
224224
"message": " compared to yesterday "

src/_locales/ru/messages.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
"description": "Установите максимальное время, разрешенное для посещения сайта в день. По истечении этого времени сайт будет заблокирован."
177177
},
178178
"limitsTip": {
179-
"message": "Если вы установите время блокировки равным 0 часам 0 минутам, сайт будет немедленно заблокирован"
179+
"message": "Если вы установите время блокировки на 0 часов 0 минут, сайт будет немедленно заблокирован"
180180
},
181181
"save": {
182182
"message": "Сохранить"
@@ -200,13 +200,13 @@
200200
"message": "Если \u0443 вас есть вопрос или вы хотели бы сообщить \u043E проблеме, вы можете сделать это на"
201201
},
202202
"question": {
203-
"message": "Также вы можете задать вопросы или оставить свои предложения здесь"
203+
"message": "Также вы можете задать вопросы или оставить свои предложения "
204204
},
205205
"supportForm": {
206206
"message": "поддержка"
207207
},
208208
"doYouEnjoy": {
209-
"message": "Вам нравится использовать Web Activity Time Tracker?"
209+
"message": "Вам нравится Web Activity Time Tracker?"
210210
},
211211
"review": {
212212
"message": "Оставьте отзыв!"

src/components/BadgeIcons.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div class="d-inline-block">
33
<span v-if="showDocumentBadge" class="badge-document">{{ t('document.message') }}</span>
4+
<span v-if="showChromeBadge" class="badge-chrome">Chrome</span>
45
<span v-if="showLimitBadge" class="badge-block">{{ t('limit.message') }}</span>
56
</div>
67
</template>
@@ -36,9 +37,18 @@ const showLimitBadge = computed(
3637
(props.listType == TypeOfList.Today || props.listType == TypeOfList.Dashboard) &&
3738
isLimit.value == true,
3839
);
40+
const showChromeBadge = computed(() => props.type == TypeOfUrl.Chrome);
3941
</script>
4042

4143
<style scoped>
44+
span.badge-chrome {
45+
border-radius: 6px;
46+
background-color: #3aab58;
47+
padding: 3px 7px;
48+
font-size: 11px;
49+
color: white;
50+
font-weight: 600;
51+
}
4252
span.badge-document {
4353
border-radius: 6px;
4454
background-color: #0043ff9e;

src/components/TabItem.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ const props = defineProps<{
4747
listType: TypeOfList;
4848
}>();
4949
50-
const typeOfUrl = computed(() =>
51-
props.item.url.startsWith('file:') ? TypeOfUrl.Document : TypeOfUrl.WebSite,
52-
);
50+
const typeOfUrl = computed(() => {
51+
if (props.item.url.startsWith('file:')) return TypeOfUrl.Document;
52+
if (props.item.url.startsWith('chrome://') || props.item.url.startsWith('chrome-extension://'))
53+
return TypeOfUrl.Chrome;
54+
return TypeOfUrl.WebSite;
55+
});
5356
5457
const url = computed(() =>
5558
typeOfUrl.value == TypeOfUrl.Document

src/compositions/extract-hostname.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ export function extractHostname(url: string | undefined): string {
66
return url;
77
}
88

9+
if (url.startsWith('chrome://') || url.startsWith('chrome-extension://')) {
10+
return url;
11+
}
12+
913
if (url.indexOf('//') > -1) {
1014
hostname = url.split('/')[2];
1115
} else {

src/compositions/valid-page.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ export function isValidPage(tab: Browser.Tabs.Tab | undefined): boolean {
44
if (tab == null || tab == undefined || !tab.url || !tab.id) return false;
55

66
if (
7-
(!tab.url.startsWith('http:') &&
8-
!tab.url.startsWith('https:') &&
9-
!tab.url.startsWith('file:')) ||
10-
tab.url.startsWith('chrome://') ||
11-
tab.url.startsWith('chrome-extension://')
7+
!tab.url.startsWith('http:') &&
8+
!tab.url.startsWith('https:') &&
9+
!tab.url.startsWith('file:') &&
10+
!tab.url.startsWith('chrome://') &&
11+
!tab.url.startsWith('chrome-extension://')
1212
)
1313
return false;
1414
return true;

src/utils/enums.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ export enum ListWithTime {
2727
export enum TypeOfUrl {
2828
WebSite,
2929
Document,
30+
Chrome,
3031
}

0 commit comments

Comments
 (0)