mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07cd292bee | ||
|
|
3b42a5a35b | ||
|
|
fafff3d9a8 | ||
|
|
b7fc3a8223 | ||
|
|
d2b859c5d8 | ||
|
|
17c49ace63 | ||
|
|
fa7b9eee01 | ||
|
|
6ad146e93d | ||
|
|
02b6ec7c6f | ||
|
|
9ee80cca99 | ||
|
|
950b5dd6c4 |
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@@ -16,13 +16,6 @@ jobs:
|
||||
with:
|
||||
node-version: '18'
|
||||
- run: npm ci
|
||||
- run: sudo apt-get remove google-chrome-stable
|
||||
|
||||
- uses: browser-actions/setup-chrome@c785b87e244131f27c9f19c1a33e2ead956ab7ce
|
||||
with:
|
||||
chrome-version: 135
|
||||
install-dependencies: true
|
||||
install-chromedriver: true
|
||||
|
||||
- name: Copy configuration
|
||||
run: cp config.json.example config.json
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "__MSG_fullName__",
|
||||
"short_name": "SponsorBlock",
|
||||
"version": "5.13.1",
|
||||
"version": "5.13.2",
|
||||
"default_locale": "en",
|
||||
"description": "__MSG_Description__",
|
||||
"homepage_url": "https://sponsor.ajay.app",
|
||||
|
||||
16
package-lock.json
generated
16
package-lock.json
generated
@@ -41,7 +41,7 @@
|
||||
"@types/wicg-mediasession": "^1.1.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
||||
"@typescript-eslint/parser": "^5.54.1",
|
||||
"chromedriver": "^135.0.0",
|
||||
"chromedriver": "^137.0.0",
|
||||
"concurrently": "^7.6.0",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"eslint": "^8.35.0",
|
||||
@@ -4085,9 +4085,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/chromedriver": {
|
||||
"version": "135.0.3",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-135.0.3.tgz",
|
||||
"integrity": "sha512-ZVd9NhChPm8u1s1kSYpEaTtoS6bEVnv8GdvTfKONicbLz57zLU5mxYILiz8qs5rXxig4QhB6+hSmJ1ki+s+L3A==",
|
||||
"version": "137.0.4",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-137.0.4.tgz",
|
||||
"integrity": "sha512-IxipIe0AnoQhWvG6eSTOLhVf1Tt586LA1IH4RdhGhXrrK6nZx8+VcKdjtlyZIV60S0CttUij/YnYuHAI+7qzWg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
@@ -4104,7 +4104,7 @@
|
||||
"chromedriver": "bin/chromedriver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/ci-info": {
|
||||
@@ -17005,9 +17005,9 @@
|
||||
}
|
||||
},
|
||||
"chromedriver": {
|
||||
"version": "135.0.3",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-135.0.3.tgz",
|
||||
"integrity": "sha512-ZVd9NhChPm8u1s1kSYpEaTtoS6bEVnv8GdvTfKONicbLz57zLU5mxYILiz8qs5rXxig4QhB6+hSmJ1ki+s+L3A==",
|
||||
"version": "137.0.4",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-137.0.4.tgz",
|
||||
"integrity": "sha512-IxipIe0AnoQhWvG6eSTOLhVf1Tt586LA1IH4RdhGhXrrK6nZx8+VcKdjtlyZIV60S0CttUij/YnYuHAI+7qzWg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@testim/chrome-version": "^1.1.4",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"@types/wicg-mediasession": "^1.1.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
||||
"@typescript-eslint/parser": "^5.54.1",
|
||||
"chromedriver": "^135.0.0",
|
||||
"chromedriver": "^137.0.0",
|
||||
"concurrently": "^7.6.0",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"eslint": "^8.35.0",
|
||||
|
||||
Submodule public/_locales updated: 163f20795e...1314fb8089
@@ -102,10 +102,6 @@ div:hover > #previewbar.sbNotInvidious {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.ytp-tooltip.sponsorCategoryTooltipVisible:not(.sponsorTooltipHasYTChapters) {
|
||||
transform: translateY(-1em) !important;
|
||||
}
|
||||
|
||||
/* Pull up for precise seeking */
|
||||
.ytp-tooltip.sponsorCategoryTooltipVisible .ytp-tooltip-edu {
|
||||
transform: translateY(-1em) !important;
|
||||
|
||||
@@ -1355,7 +1355,9 @@ function startSkipScheduleCheckingForStartSponsors() {
|
||||
// For highlight category
|
||||
const poiSegments = sponsorTimes
|
||||
.filter((time) => time.segment[1] > getCurrentTime()
|
||||
&& time.actionType === ActionType.Poi && time.hidden === SponsorHideType.Visible)
|
||||
&& time.actionType === ActionType.Poi
|
||||
&& time.hidden === SponsorHideType.Visible
|
||||
&& getCategorySelection(time).option !== CategorySkipOption.Disabled)
|
||||
.sort((a, b) => b.segment[0] - a.segment[0]);
|
||||
for (const time of poiSegments) {
|
||||
const skipOption = getCategorySelection(time)?.option;
|
||||
|
||||
@@ -5,7 +5,7 @@ https://github.com/videosegments/videosegments/commits/f1e111bdfe231947800c6efdd
|
||||
|
||||
import Config from "../config";
|
||||
import { ChapterVote } from "../render/ChapterVote";
|
||||
import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceType, SponsorTime } from "../types";
|
||||
import { ActionType, Category, CategorySkipOption, SegmentContainer, SponsorHideType, SponsorSourceType, SponsorTime } from "../types";
|
||||
import { partition } from "../utils/arrayUtils";
|
||||
import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils";
|
||||
import { normalizeChapterName } from "../utils/exporter";
|
||||
@@ -14,6 +14,7 @@ import { addCleanupListener } from "../../maze-utils/src/cleanup";
|
||||
import { hasAutogeneratedChapters, isVisible } from "../utils/pageUtils";
|
||||
import { isVorapisInstalled } from "../utils/compatibility";
|
||||
import { isOnYTTV } from "../../maze-utils/src/video";
|
||||
import { getCategorySelection } from "../utils/skipRule";
|
||||
|
||||
const TOOLTIP_VISIBLE_CLASS = 'sponsorCategoryTooltipVisible';
|
||||
const MIN_CHAPTER_SIZE = 0.003;
|
||||
@@ -186,10 +187,6 @@ class PreviewBar {
|
||||
// Hide original tooltip if some chapter has been filtered out
|
||||
originalTooltip.style.display = "none";
|
||||
noYoutubeChapters = true;
|
||||
|
||||
originalTooltip.classList.add("sponsorTooltipHasYTChapters");
|
||||
} else {
|
||||
originalTooltip.classList.remove("sponsorTooltipHasYTChapters");
|
||||
}
|
||||
|
||||
if (mainSegment === null && secondarySegment === null) {
|
||||
@@ -210,7 +207,6 @@ class PreviewBar {
|
||||
const hasTwoTooltips = mainSegment !== null && secondarySegment !== null;
|
||||
if (hasTwoTooltips) {
|
||||
this.categoryTooltipContainer.classList.add("sponsorTwoTooltips");
|
||||
originalTooltip.classList.remove("sponsorTooltipHasYTChapters");
|
||||
} else {
|
||||
this.categoryTooltipContainer.classList.remove("sponsorTwoTooltips");
|
||||
}
|
||||
@@ -894,7 +890,8 @@ class PreviewBar {
|
||||
const activeSegments = segments.filter((segment) => {
|
||||
return segment.hidden === SponsorHideType.Visible
|
||||
&& segment.segment[0] <= currentTime && segment.segment[1] > currentTime
|
||||
&& segment.category !== DEFAULT_CATEGORY;
|
||||
&& segment.category !== DEFAULT_CATEGORY
|
||||
&& getCategorySelection(segment).option !== CategorySkipOption.Disabled
|
||||
});
|
||||
|
||||
this.setActiveSegments(activeSegments);
|
||||
|
||||
@@ -6,6 +6,7 @@ import { asyncRequestToServer } from "../utils/requests";
|
||||
import PencilIcon from "../svg-icons/pencilIcon";
|
||||
import ClipboardIcon from "../svg-icons/clipboardIcon";
|
||||
import CheckIcon from "../svg-icons/checkIcon";
|
||||
import { showDonationLink } from "../utils/configUtils";
|
||||
|
||||
export const YourWorkComponent = () => {
|
||||
const [isSettingUsername, setIsSettingUsername] = React.useState(false);
|
||||
@@ -36,7 +37,7 @@ export const YourWorkComponent = () => {
|
||||
Config.config!.permissions = userInfo.permissions;
|
||||
|
||||
setShowDonateMessage(Config.config.showDonationLink && Config.config.donateClicked <= 0 && Config.config.showPopupDonationCount < 5
|
||||
&& viewCount < 50000 && !Config.config.isVip && Config.config.skipCount > 10);
|
||||
&& viewCount < 50000 && !Config.config.isVip && Config.config.skipCount > 10 && showDonationLink());
|
||||
}
|
||||
})();
|
||||
}, []);
|
||||
@@ -167,7 +168,7 @@ function TimeSavedMessage({ viewCount, minutesSaved }: { viewCount: number; minu
|
||||
<span className="sbExtraInfo">
|
||||
{"("}{" "}
|
||||
<b>
|
||||
<span id="sponsorTimeSavedDisplay">{Config.config.minutesSaved}</span>{" "}
|
||||
<span id="sponsorTimeSavedDisplay">{getFormattedHours(Config.config.minutesSaved)}</span>{" "}
|
||||
<span id="sponsorTimeSavedEndWord">{Config.config.minutesSaved !== 1 ? chrome.i18n.getMessage("minsLower") : chrome.i18n.getMessage("minLower")}</span>{" "}
|
||||
</b>
|
||||
{")"}
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as Path from "path";
|
||||
|
||||
import * as fs from "fs";
|
||||
|
||||
test("Selenium Chrome test", async () => {
|
||||
xtest("Selenium Chrome test", async () => {
|
||||
let driver: WebDriver;
|
||||
try {
|
||||
driver = await setup();
|
||||
@@ -12,6 +12,11 @@ test("Selenium Chrome test", async () => {
|
||||
console.warn("A browser is probably not installed, skipping selenium tests");
|
||||
console.warn(e);
|
||||
|
||||
if (String(e).includes("This version of ChromeDriver only supports")) {
|
||||
// Count as failure
|
||||
throw e;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +63,7 @@ async function setup(): Promise<WebDriver> {
|
||||
options.addArguments("--headless=new");
|
||||
options.addArguments("--window-size=1920,1080");
|
||||
|
||||
const driver = await new Builder().forBrowser("chromium").setChromeOptions(options).build();
|
||||
const driver = await new Builder().forBrowser("chrome").setChromeOptions(options).build();
|
||||
driver.manage().setTimeouts({
|
||||
implicit: 5000
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user