From 1b92982f3b7ce1e26d82914d097fe0631311387c Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Mon, 14 Dec 2020 22:34:18 +0100 Subject: [PATCH 001/103] chore(ci): add linter to workflow --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60e01530..68a6f2e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,10 @@ jobs: - name: Copy configuration run: cp config.json.example config.json + # Run linter + - name: Lint + run: npm run lint + # Create Chrome artifacts - name: Create Chrome artifacts run: npm run build:chrome From 3ac68aa3130b43bb3f7c72aa3ee9113b75d38d09 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 29 Dec 2020 23:06:50 -0500 Subject: [PATCH 002/103] Revert "Add notice about YouCap" This reverts commit e95029c22939eee881391e53355a1aa813fd839c. --- src/components/SubmissionNoticeComponent.tsx | 36 +------------------- src/config.ts | 8 ++--- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index 23726df6..c6aae60a 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -32,8 +32,6 @@ class SubmissionNoticeComponent extends React.Component - {this.getYouCapMessage()} - {/* Last Row */} @@ -117,36 +113,6 @@ class SubmissionNoticeComponent extends React.Component -

- Like contributing to crowdsourced projects? - Consider checking out YouCap, - a new open-source replacement for YouTube{"'"}s now defunct community captions. - YouCap is NOT made by me, but I think it looks like a cool idea. -

- - { this.showingYouCapNotice = false; this.forceUpdate(); }}> - - - ); - } - getSponsorTimeMessages(): JSX.Element[] | JSX.Element { const elements: JSX.Element[] = []; this.timeEditRefs = []; diff --git a/src/config.ts b/src/config.ts index d113e86c..2a40dbf6 100644 --- a/src/config.ts +++ b/src/config.ts @@ -55,9 +55,7 @@ interface SBConfig { "preview-selfpromo": PreviewBarOption, "music_offtopic": PreviewBarOption, "preview-music_offtopic": PreviewBarOption, - }, - - hasShownYouCapNotice: boolean + } } export interface SBObject { @@ -231,9 +229,7 @@ const Config: SBObject = { color: "#a6634a", opacity: "0.7" } - }, - - hasShownYouCapNotice: false + } }, localConfig: null, config: null, From 647a3839d0eee696f1c9c5ff4351586117d5f64a Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 2 Jan 2021 20:10:47 -0500 Subject: [PATCH 003/103] Make link open in new tab --- src/components/SubmissionNoticeComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index c1c34643..381c5109 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -133,7 +133,7 @@ class SubmissionNoticeComponent extends React.Component

Like contributing to crowdsourced projects? - Consider checking out YouCap or NekoCap, + Consider checking out YouCap or NekoCap, new open-source replacements for YouTube{"'"}s now defunct community captions.

From 33ec82882dcc3b4637f6f3661fd1e67a886cdc8e Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 2 Jan 2021 20:11:00 -0500 Subject: [PATCH 004/103] Increase version number --- manifest/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest/manifest.json b/manifest/manifest.json index ca053854..7f60599f 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "SponsorBlock", - "version": "2.0.11", + "version": "2.0.11.2", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [{ From 7307340afa08f681f0c4a8ae8c64954dc4d67056 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 17 Jan 2021 12:53:31 -0500 Subject: [PATCH 005/103] Remove empty unsubmitted segments Resolves https://github.com/ajayyy/SponsorBlock/issues/609 --- src/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index 2a40dbf6..c64800e8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -247,10 +247,10 @@ const Config: SBObject = { * * @param data */ -function encodeStoredItem(data: T): T | Array { +function encodeStoredItem(data: T): T | Array<[string, Array]> { // if data is SBMap convert to json for storing if(!(data instanceof SBMap)) return data; - return Array.from(data.entries()); + return Array.from(data.entries()).filter((element) => element[1] === []); // Remove empty entries } /** From 7bb8f446bffbab9ecf6b8ee790653960d1d72928 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 17 Jan 2021 12:56:37 -0500 Subject: [PATCH 006/103] Fix type issues --- src/config.ts | 6 +++--- src/types.ts | 42 ++++++++++++++---------------------------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/src/config.ts b/src/config.ts index c64800e8..4eb3e43d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,5 @@ import * as CompileConfig from "../config.json"; -import { CategorySelection, CategorySkipOption, PreviewBarOption, SponsorTime, StorageChangesObject } from "./types"; +import { CategorySelection, CategorySkipOption, PreviewBarOption, SponsorTime, StorageChangesObject, UnEncodedSegmentTimes as UnencodedSegmentTimes } from "./types"; import Utils from "./utils"; const utils = new Utils(); @@ -247,7 +247,7 @@ const Config: SBObject = { * * @param data */ -function encodeStoredItem(data: T): T | Array<[string, Array]> { +function encodeStoredItem(data: T): T | UnencodedSegmentTimes { // if data is SBMap convert to json for storing if(!(data instanceof SBMap)) return data; return Array.from(data.entries()).filter((element) => element[1] === []); // Remove empty entries @@ -265,7 +265,7 @@ function decodeStoredItem(id: string, data: T): T | SBMap void, dontShowNoticeAgain: () => void, @@ -22,34 +22,34 @@ interface ContentContainer { } } -interface FetchResponse { +export interface FetchResponse { responseText: string, status: number, ok: boolean } -interface VideoDurationResponse { +export interface VideoDurationResponse { duration: number; } -enum CategorySkipOption { +export enum CategorySkipOption { ShowOverlay, ManualSkip, AutoSkip } -interface CategorySelection { +export interface CategorySelection { name: string; option: CategorySkipOption } -enum SponsorHideType { +export enum SponsorHideType { Visible = undefined, Downvoted = 1, MinimumDuration } -interface SponsorTime { +export interface SponsorTime { segment: number[]; UUID: string; @@ -58,13 +58,13 @@ interface SponsorTime { hidden?: SponsorHideType; } -interface PreviewBarOption { +export interface PreviewBarOption { color: string, opacity: string } -interface Registration { +export interface Registration { message: string, id: string, allFrames: boolean, @@ -73,12 +73,12 @@ interface Registration { matches: string[] } -interface BackgroundScriptContainer { +export interface BackgroundScriptContainer { registerFirefoxContentScript: (opts: Registration) => void, unregisterFirefoxContentScript: (id: string) => void } -interface VideoInfo { +export interface VideoInfo { responseContext: { serviceTrackingParams: Array<{service: string, params: Array<{key: string, value: string}>}>, webResponseContextExtensionData: { @@ -154,22 +154,8 @@ interface VideoInfo { messages: unknown; } -type VideoID = string; +export type VideoID = string; -type StorageChangesObject = { [key: string]: chrome.storage.StorageChange }; +export type StorageChangesObject = { [key: string]: chrome.storage.StorageChange }; -export { - FetchResponse, - VideoDurationResponse, - ContentContainer, - CategorySelection, - CategorySkipOption, - SponsorTime, - VideoID, - SponsorHideType, - PreviewBarOption, - Registration, - BackgroundScriptContainer, - VideoInfo, - StorageChangesObject, -}; +export type UnEncodedSegmentTimes = [string, SponsorTime[]][]; \ No newline at end of file From 2fcfc989cf739ee3c4756b6bd5bad8fc2f710932 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 17 Jan 2021 13:00:27 -0500 Subject: [PATCH 007/103] Remove unsubmitted notification --- manifest/manifest.json | 1 - public/_locales/en/messages.json | 9 --------- public/options/options.html | 17 ----------------- src/background.ts | 10 ---------- src/config.ts | 2 -- src/content.ts | 20 -------------------- 6 files changed, 59 deletions(-) diff --git a/manifest/manifest.json b/manifest/manifest.json index 7f60599f..c25f2275 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -46,7 +46,6 @@ ], "permissions": [ "storage", - "notifications", "https://sponsor.ajay.app/*" ], "optional_permissions": [ diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 5f92d260..0a761cf5 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -97,9 +97,6 @@ "wantToSubmit": { "message": "Do you want to submit for video id" }, - "leftTimes": { - "message": "You seem to have left some segments unsubmitted. Go back to that page to submit them (they are not deleted)." - }, "clearTimes": { "message": "Clear Segments" }, @@ -631,12 +628,6 @@ "categoryUpdate2": { "message": "Open the options to skip intros, outros, merch, etc." }, - "unsubmittedWarning": { - "message": "Unsubmitted Segments Notification" - }, - "unsubmittedWarningDescription": { - "message": "Send a notification when you leave a video with segments that are not uploaded" - }, "help": { "message": "Help" } diff --git a/public/options/options.html b/public/options/options.html index 04620a9e..68c28cbd 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -152,23 +152,6 @@

-
- - -
-
- -
__MSG_unsubmittedWarningDescription__
-
- -
-
-