mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-25 08:58:27 +03:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19635d2f06 | ||
|
|
b2a5539324 | ||
|
|
01df1e655e | ||
|
|
467e1cae50 | ||
|
|
822e00a46a | ||
|
|
74433fe751 | ||
|
|
a45690b26e | ||
|
|
f69d6736d4 | ||
|
|
ae7916b7e7 |
12
.github/workflows/tests.yml
vendored
12
.github/workflows/tests.yml
vendored
@@ -17,9 +17,21 @@ jobs:
|
|||||||
node-version: '18'
|
node-version: '18'
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: sudo apt-get install chromium-chromedriver
|
- run: sudo apt-get install chromium-chromedriver
|
||||||
|
|
||||||
|
- uses: browser-actions/setup-chrome@c785b87e244131f27c9f19c1a33e2ead956ab7ce
|
||||||
|
with:
|
||||||
|
chrome-version: 135
|
||||||
|
install-dependencies: true
|
||||||
|
install-chromedriver: true
|
||||||
|
|
||||||
- name: Copy configuration
|
- name: Copy configuration
|
||||||
run: cp config.json.example config.json
|
run: cp config.json.example config.json
|
||||||
|
|
||||||
|
- name: Set up WireGuard Connection
|
||||||
|
uses: niklaskeerl/easy-wireguard-action@50341d5f4b8245ff3a90e278aca67b2d283c78d0
|
||||||
|
with:
|
||||||
|
WG_CONFIG_FILE: ${{ secrets.WG_CONFIG_FILE }}
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "5.12",
|
"version": "5.12.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
|
|||||||
@@ -1926,13 +1926,14 @@ function createButton(baseID: string, title: string, callback: () => void, image
|
|||||||
}
|
}
|
||||||
|
|
||||||
function shouldAutoSkip(segment: SponsorTime): boolean {
|
function shouldAutoSkip(segment: SponsorTime): boolean {
|
||||||
if (segment.category === "music_offtopic" && Config.config.skipNonMusicOnlyOnYoutubeMusic && !isOnYouTubeMusic()) {
|
const canSkipNonMusic = !Config.config.skipNonMusicOnlyOnYoutubeMusic || isOnYouTubeMusic();
|
||||||
|
if (segment.category === "music_offtopic" && !canSkipNonMusic) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (!Config.config.manualSkipOnFullVideo || !sponsorTimes?.some((s) => s.category === segment.category && s.actionType === ActionType.Full))
|
return (!Config.config.manualSkipOnFullVideo || !sponsorTimes?.some((s) => s.category === segment.category && s.actionType === ActionType.Full))
|
||||||
&& (utils.getCategorySelection(segment.category)?.option === CategorySkipOption.AutoSkip ||
|
&& (utils.getCategorySelection(segment.category)?.option === CategorySkipOption.AutoSkip ||
|
||||||
(Config.config.autoSkipOnMusicVideos && sponsorTimes?.some((s) => s.category === "music_offtopic")
|
(Config.config.autoSkipOnMusicVideos && canSkipNonMusic && sponsorTimes?.some((s) => s.category === "music_offtopic")
|
||||||
&& segment.actionType === ActionType.Skip)
|
&& segment.actionType === ActionType.Skip)
|
||||||
|| sponsorTimesSubmitting.some((s) => s.segment === segment.segment))
|
|| sponsorTimesSubmitting.some((s) => s.segment === segment.segment))
|
||||||
|| isLoopedChapter(segment);
|
|| isLoopedChapter(segment);
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import Config from "../config";
|
|||||||
|
|
||||||
export function getControls(): HTMLElement {
|
export function getControls(): HTMLElement {
|
||||||
const controlsSelectors = [
|
const controlsSelectors = [
|
||||||
// YouTube
|
|
||||||
".ytp-right-controls",
|
|
||||||
// New YouTube (2025 April)
|
// New YouTube (2025 April)
|
||||||
".ytp-right-controls-right",
|
".ytp-right-controls-right",
|
||||||
|
// YouTube
|
||||||
|
".ytp-right-controls",
|
||||||
// Mobile YouTube
|
// Mobile YouTube
|
||||||
".player-controls-top",
|
".player-controls-top",
|
||||||
// Invidious/videojs video element's controls element
|
// Invidious/videojs video element's controls element
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ async function editSegments(driver: WebDriver, index: number, expectedStartTimeB
|
|||||||
await endTimeBox.clear();
|
await endTimeBox.clear();
|
||||||
await endTimeBox.sendKeys(endTime);
|
await endTimeBox.sendKeys(endTime);
|
||||||
|
|
||||||
|
await driver.sleep(1000);
|
||||||
|
|
||||||
editButton = await driver.findElement(By.id("sponsorTimeEditButtonSubmissionNotice" + index));
|
editButton = await driver.findElement(By.id("sponsorTimeEditButtonSubmissionNotice" + index));
|
||||||
await editButton.click();
|
await editButton.click();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user