diff options
-rw-r--r-- | package-lock.json | 12 | ||||
m--------- | public/_locales | 0 | ||||
-rw-r--r-- | public/options/options.html | 14 | ||||
-rw-r--r-- | src/config.ts | 2 | ||||
-rw-r--r-- | src/js-components/previewBar.ts | 1 | ||||
-rw-r--r-- | src/utils.ts | 3 |
6 files changed, 24 insertions, 8 deletions
diff --git a/package-lock.json b/package-lock.json index ada13159..c5c5db5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6110,9 +6110,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", - "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "dev": true, "funding": [ { @@ -18369,9 +18369,9 @@ "dev": true }, "follow-redirects": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", - "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "dev": true }, "for-each": { diff --git a/public/_locales b/public/_locales -Subproject 01ee7789673ac009fe1ea10be66fda7698534c4 +Subproject afc1c61dcea11bb9723105ff7730951ec9303d9 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 @@ <div class="small-description">__MSG_whatTrackDownvotes__</div> </div> - + + <div data-type="toggle" data-sync="trackDownvotesInPrivate" data-confirm-on="false"> + <div class="switch-container"> + <label class="switch"> + <input id="trackDownvotesInPrivate" type="checkbox" checked> + <span class="slider round"></span> + </label> + <label class="switch-label" for="trackDownvotesInPrivate"> + __MSG_enableTrackDownvotesInPrivate__ + </label> + </div> + </div> + <div data-type="button-press" data-sync="copyDebugInformation" data-confirm-message="copyDebugInformation"> <div class="option-button trigger-button"> __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/js-components/previewBar.ts b/src/js-components/previewBar.ts index 5e002fb9..db452bfa 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -748,6 +748,7 @@ class PreviewBar { updateChapterText(segments: SponsorTime[], submittingSegments: SponsorTime[], currentTime: number): SponsorTime[] { if (!Config.config.showSegmentNameInChapterBar + || Config.config.disableSkipping || ((!segments || segments.length <= 0) && submittingSegments?.length <= 0)) { const chaptersContainer = this.getChaptersContainer(); if (chaptersContainer) { 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); |