From de094cb11f69b3b19dfb4dc3ce317cbd132eff32 Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 18 Mar 2024 19:45:35 -0400 Subject: Add option to store downvotes when done in private tabs --- public/_locales | 2 +- public/options/options.html | 14 +++++++++++++- src/config.ts | 2 ++ src/utils.ts | 3 ++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/public/_locales b/public/_locales index 01ee7789..afc1c61d 160000 --- a/public/_locales +++ b/public/_locales @@ -1 +1 @@ -Subproject commit 01ee7789673ac009fe1ea10be66fda7698534c4c +Subproject commit afc1c61dcea11bb9723105ff7730951ec9303d91 diff --git a/public/options/options.html b/public/options/options.html index 146b7956..b8746c5d 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -634,7 +634,19 @@
__MSG_whatTrackDownvotes__
- + +
+
+ + +
+
+
__MSG_copyDebugInformation__ diff --git a/src/config.ts b/src/config.ts index 81f41997..85847a5e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -29,6 +29,7 @@ interface SBConfig { trackViewCount: boolean; trackViewCountInPrivate: boolean; trackDownvotes: boolean; + trackDownvotesInPrivate: boolean; dontShowNotice: boolean; noticeVisibilityMode: NoticeVisbilityMode; hideVideoPlayerControls: boolean; @@ -290,6 +291,7 @@ const syncDefaults = { trackViewCount: true, trackViewCountInPrivate: true, trackDownvotes: true, + trackDownvotesInPrivate: false, dontShowNotice: false, noticeVisibilityMode: NoticeVisbilityMode.FadedForAutoSkip, hideVideoPlayerControls: false, diff --git a/src/utils.ts b/src/utils.ts index c96a7772..7c3f985e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -281,7 +281,8 @@ export default class Utils { } async addHiddenSegment(videoID: VideoID, segmentUUID: string, hidden: SponsorHideType) { - if (chrome.extension.inIncognitoContext || !Config.config.trackDownvotes) return; + if ((chrome.extension.inIncognitoContext && !Config.config.trackDownvotesInPrivate) + || !Config.config.trackDownvotes) return; const hashedVideoID = (await getHash(videoID, 1)).slice(0, 4) as VideoID & HashedValue; const UUIDHash = await getHash(segmentUUID, 1); -- cgit v1.2.3