From 941bd41cdb16138c9565e03d3faa8434388fd89e Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 13 May 2020 21:11:00 -0400 Subject: [PATCH 1/4] Added another check to prevent phantom skips --- src/content.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/content.ts b/src/content.ts index 78579023..6cb7a7ad 100644 --- a/src/content.ts +++ b/src/content.ts @@ -470,7 +470,7 @@ function startSponsorSchedule(includeIntersectingSegments: boolean = false, curr return; } - if (incorrectVideoIDCheck()) return; + if (incorrectVideoCheck()) return; if (currentTime === undefined || currentTime === null) currentTime = video.currentTime; @@ -490,7 +490,7 @@ function startSponsorSchedule(includeIntersectingSegments: boolean = false, curr let forcedSkipTime: number = null; let forcedIncludeIntersectingSegments = false; - if (incorrectVideoIDCheck(videoID)) return; + if (incorrectVideoCheck(videoID, currentSkip)) return; if (video.currentTime >= skipTime[0] && video.currentTime < skipTime[1]) { skipToTime(video, skipInfo.endIndex, skipInfo.array, skipInfo.openNotice); @@ -515,13 +515,11 @@ function startSponsorSchedule(includeIntersectingSegments: boolean = false, curr } /** - * This makes sure the videoID is still correct - * - * TODO: Remove this bug catching if statement when the bug is found + * This makes sure the videoID is still correct and if the sponsorTime is included */ -function incorrectVideoIDCheck(videoID?: string): boolean { +function incorrectVideoCheck(videoID?: string, sponsorTime?: SponsorTime): boolean { let currentVideoID = getYouTubeVideoID(document.URL); - if (currentVideoID !== (videoID || sponsorVideoID)) { + if (currentVideoID !== (videoID || sponsorVideoID) || (sponsorTime && !sponsorTimes.includes(sponsorTime))) { // Something has really gone wrong console.error("[SponsorBlock] The videoID recorded when trying to skip is different than what it should be."); console.error("[SponsorBlock] VideoID recorded: " + sponsorVideoID + ". Actual VideoID: " + currentVideoID); From cff72b19c7816d0122b462d587ce35318cfca5d9 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Fri, 15 May 2020 19:39:37 -0400 Subject: [PATCH 2/4] Enable category vote on main server --- src/components/SkipNoticeComponent.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index b4399e65..e1ecf01c 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -198,13 +198,11 @@ class SkipNoticeComponent extends React.Component {/* Category vote */} - {Config.config.testingServer && - - } + {chrome.i18n.getMessage("incorrectCategory")} + From ba13f5951e6e93f8c2882dd678ce1307d3ec1ca3 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Fri, 15 May 2020 19:40:24 -0400 Subject: [PATCH 3/4] 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 6543f6b1..6c077f83 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "__MSG_Name__", - "version": "1.2.28.2", + "version": "1.2.28.3", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [{ From 1ab1f33cafaf5169682f1053cff07447e1ddca6a Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Fri, 15 May 2020 20:51:24 -0400 Subject: [PATCH 4/4] Change zip binary in release workflow --- .github/workflows/release.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35882cbc..e902a81d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,9 @@ jobs: - run: npm install - name: Copy configuration run: cp config.json.example config.json + + - name: Install Zip + run: sudo apt-get install zip # Create Chrome artifacts - name: Create Chrome artifacts @@ -28,9 +31,7 @@ jobs: - run: mkdir ./builds - name: Zip Artifacts run: cd ./dist - - uses: montudor/action-zip@v0.1.0 - with: - args: zip -r ../builds/ChromeExtension.zip * + - run: zip -r ../builds/ChromeExtension.zip * - run: cd ../ # Create Firefox artifacts @@ -56,9 +57,7 @@ jobs: path: dist - name: Zip Artifacts run: cd ./dist - - uses: montudor/action-zip@v0.1.0 - with: - args: zip -r ../builds/ChromeExtensionBeta.zip * + - run: zip -r ../builds/ChromeExtensionBeta.zip * - run: cd ../ - name: Create Firefox Beta artifacts @@ -69,9 +68,7 @@ jobs: path: dist - name: Zip Artifacts run: cd ./dist - - uses: montudor/action-zip@v0.1.0 - with: - args: zip -r ../builds/FirefoxExtensionBeta.zip * + - run: zip -r ../builds/FirefoxExtensionBeta.zip * - run: cd ../ # Create Firefox Signed Beta version