Compare commits

...

14 Commits

Author SHA1 Message Date
Ajay
d7db6d58c5 bump version 2025-05-27 12:51:20 -04:00
Ajay
56a2d76f38 Fix next chapter hotkey causing multiple chapters to be skipped on Chrome
Fixes #2276
2025-05-27 12:51:07 -04:00
Ajay
4a7d431a17 bump translations 2025-05-24 02:11:15 -04:00
Ajay
a91ff4e49f bump version 2025-05-24 02:10:48 -04:00
Ajay
fcb9f32d4c Fix skip keybind also being used for skip to highlight
Fixes #2274
2025-05-24 02:10:38 -04:00
Ajay
cf4d13a756 Fix next chapter hotkey causing multiple chapters to be skipped
Fixes #2273
2025-05-24 02:07:36 -04:00
Ajay
75d0043e45 Make popup more accessible 2025-05-23 04:24:13 -04:00
Ajay Ramachandran
2391337ee2 Merge pull request #2252 from ajayyy/dependabot/npm_and_yarn/axios-1.8.4
Bump axios from 1.7.7 to 1.8.4
2025-05-16 04:09:57 -04:00
Ajay
1074f653b2 bump version 2025-05-16 02:17:05 -04:00
Ajay
a12601180e update translations 2025-05-16 02:16:57 -04:00
Ajay
3a7716240d Fix time without skip for new yt player
Fixes #2263
2025-05-14 01:24:54 -04:00
Ajay Ramachandran
93f44859b2 Merge pull request #2255 from mini-bomba/useragent
Use useragent generator from maze-utils
2025-04-28 01:26:39 -04:00
mini-bomba
376ce21eae Use useragent generator from maze-utils 2025-04-26 19:39:58 +02:00
dependabot[bot]
3bb4cf4fbc Bump axios from 1.7.7 to 1.8.4
Bumps [axios](https://github.com/axios/axios) from 1.7.7 to 1.8.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.7...v1.8.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.8.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-24 01:34:34 +00:00
8 changed files with 53 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "5.12.1",
"version": "5.12.4",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",

13
package-lock.json generated
View File

@@ -3313,10 +3313,11 @@
}
},
"node_modules/axios": {
"version": "1.7.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
"dev": true,
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
@@ -16480,9 +16481,9 @@
"dev": true
},
"axios": {
"version": "1.7.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
"dev": true,
"requires": {
"follow-redirects": "^1.15.6",

View File

@@ -293,7 +293,7 @@
padding: 10px 15px;
transition: background-color 0.2s ease-in-out;
}
.sbControlsMenu-item:hover {
.sbControlsMenu-item:hover, .sbControlsMenu-item:focus {
background-color: #444;
}
.sbControlsMenu-itemIcon {

View File

@@ -47,7 +47,7 @@
<div id="issueReporterImportExport" class="hidden">
<div id="importExportButtons">
<button id="importSegmentsButton" title="__MSG_importSegments__">
<img src="/icons/import.svg" alt="Refresh icon" id="importSegments" />
<img src="/icons/import.svg" alt="Import icon" id="importSegments" />
</button>
<button id="exportSegmentsButton" class="hidden" title="__MSG_exportSegments__">
<img src="/icons/export.svg" alt="Export icon" id="exportSegments" />
@@ -67,7 +67,7 @@
<!-- Toggle Box -->
<div class="sbControlsMenu">
<label id="whitelistButton" for="whitelistToggle" class="hidden sbControlsMenu-item">
<label id="whitelistButton" for="whitelistToggle" class="hidden sbControlsMenu-item" role="button" tabIndex="0">
<input type="checkbox" style="display: none" id="whitelistToggle">
<svg viewBox="0 0 24 24" width="23" height="23" class="SBWhitelistIcon sbControlsMenu-itemIcon">
<path d="M24 10H14V0h-4v10H0v4h10v10h4V14h10z" />
@@ -76,7 +76,7 @@
<span id="unwhitelistChannel" style="display: none">__MSG_removeFromWhitelist__</span>
</label>
<!--github: mbledkowski/toggle-switch-->
<label id="disableExtension" for="toggleSwitch" class="toggleSwitchContainer sbControlsMenu-item">
<label id="disableExtension" for="toggleSwitch" class="toggleSwitchContainer sbControlsMenu-item" role="button" tabIndex="0">
<span class="toggleSwitchContainer-switch">
<input type="checkbox" style="display: none" id="toggleSwitch" checked>
<span class="switchBg shadow"></span>

View File

@@ -33,7 +33,7 @@ import { logDebug, logWarn } from "./utils/logger";
import { importTimes } from "./utils/exporter";
import { ChapterVote } from "./render/ChapterVote";
import { openWarningDialog } from "./utils/warnings";
import { isFirefoxOrSafari, waitFor } from "../maze-utils/src";
import { extensionUserAgent, isFirefoxOrSafari, waitFor } from "../maze-utils/src";
import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube, isOnYouTubeMusic, isOnYTTV, getLastNonInlineVideoID, triggerVideoIDChange, triggerVideoElementChange, getIsInline, getCurrentTime, setCurrentTime, getVideoDuration, verifyCurrentTime, waitForVideo } from "../maze-utils/src/video";
import { Keybind, StorageChangesObject, isSafari, keybindEquals, keybindToString } from "../maze-utils/src/config";
@@ -2470,7 +2470,7 @@ async function sendSubmitMessage(): Promise<boolean> {
userID: Config.config.userID,
segments: sponsorTimesSubmitting,
videoDuration: getVideoDuration(),
userAgent: `${chrome.runtime.id}/v${chrome.runtime.getManifest().version}`
userAgent: extensionUserAgent(),
});
if (response.status === 200) {
@@ -2617,23 +2617,13 @@ async function handleKeybindVote(type: number): Promise<void>{
}
function addHotkeyListener(): void {
document.addEventListener("keydown", hotkeyListener);
document.addEventListener("keydown", hotkeyListener, true);
document.addEventListener("keyup", hotkeyPropagationListener, true);
const onLoad = () => {
// Allow us to stop propagation to YouTube by being deeper
document.removeEventListener("keydown", hotkeyListener);
document.body.addEventListener("keydown", hotkeyListener);
addCleanupListener(() => {
document.body.removeEventListener("keydown", hotkeyListener);
});
};
if (document.readyState === "complete") {
onLoad();
} else {
document.addEventListener("DOMContentLoaded", onLoad);
}
addCleanupListener(() => {
document.body.removeEventListener("keydown", hotkeyListener, true);
document.body.removeEventListener("keyup", hotkeyPropagationListener, true);
});
}
function hotkeyListener(e: KeyboardEvent): void {
@@ -2663,7 +2653,7 @@ function hotkeyListener(e: KeyboardEvent): void {
const downvoteKey = Config.config.downvoteKeybind;
if (keybindEquals(key, skipKey)) {
if (activeSkipKeybindElement) {
if (activeSkipKeybindElement && !(activeSkipKeybindElement instanceof SkipButtonControlBar)) {
activeSkipKeybindElement.toggleSkip.call(activeSkipKeybindElement);
}
@@ -2713,6 +2703,32 @@ function hotkeyListener(e: KeyboardEvent): void {
}
}
function hotkeyPropagationListener(e: KeyboardEvent): void {
if ((["textarea", "input"].includes(document.activeElement?.tagName?.toLowerCase())
|| (document.activeElement as HTMLElement)?.isContentEditable
|| document.activeElement?.id?.toLowerCase()?.match(/editable|input/))
&& document.hasFocus()) return;
const key: Keybind = {
key: e.key,
code: e.code,
alt: e.altKey,
ctrl: e.ctrlKey,
shift: e.shiftKey
};
const nextChapterKey = Config.config.nextChapterKeybind;
const previousChapterKey = Config.config.previousChapterKeybind;
if (keybindEquals(key, nextChapterKey)) {
if (sponsorTimes.length > 0) e.stopPropagation();
return;
} else if (keybindEquals(key, previousChapterKey)) {
if (sponsorTimes.length > 0) e.stopPropagation();
return;
}
}
/**
* Adds the CSS to the page if needed. Required on optional sites with Chrome.
*/
@@ -2762,7 +2778,7 @@ function showTimeWithoutSkips(skippedDuration: number): void {
isOnInvidious() ? ".vjs-duration" :
isOnYTTV() ? ".ypl-full-controls .ypmcs-control .time-info-bar" :
isOnMobileYouTube() ? ".ytwPlayerTimeDisplayContent" :
".ytp-time-display.notranslate .ytp-time-wrapper";
".ytp-time-display.notranslate .ytp-time-wrapper .ytp-time-contents";
const display = document.querySelector(selector);
if (!display) return;

View File

@@ -5,6 +5,7 @@ import * as CompileConfig from "../../config.json";
import { ActionType, ActionTypes, SponsorSourceType, SponsorTime, VideoID } from "../types";
import { getHashParams } from "./pageUtils";
import { asyncRequestToServer } from "./requests";
import { extensionUserAgent } from "../../maze-utils/src";
const segmentDataCache = new DataCache<VideoID, SegmentResponse>(() => {
return {
@@ -57,7 +58,7 @@ async function fetchSegmentsForVideo(videoID: VideoID): Promise<SegmentResponse>
trimUUIDs: hasDownvotedSegments ? null : 5,
...extraRequestData
}, {
"X-CLIENT-NAME": `${chrome.runtime.id}/v${chrome.runtime.getManifest().version}`
"X-CLIENT-NAME": extensionUserAgent(),
});
if (response.ok) {
@@ -103,4 +104,4 @@ function getEnabledActionTypes(forceFullVideo = false): ActionType[] {
}
return actionTypes;
}
}