mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-15 16:07:06 +03:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7db6d58c5 | ||
|
|
56a2d76f38 | ||
|
|
4a7d431a17 | ||
|
|
a91ff4e49f | ||
|
|
fcb9f32d4c | ||
|
|
cf4d13a756 | ||
|
|
75d0043e45 | ||
|
|
2391337ee2 | ||
|
|
3bb4cf4fbc |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "5.12.2",
|
"version": "5.12.4",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
|
|||||||
13
package-lock.json
generated
13
package-lock.json
generated
@@ -3313,10 +3313,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.7.7",
|
"version": "1.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
|
||||||
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
|
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.6",
|
"follow-redirects": "^1.15.6",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
@@ -16480,9 +16481,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"axios": {
|
"axios": {
|
||||||
"version": "1.7.7",
|
"version": "1.8.4",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
|
||||||
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
|
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"follow-redirects": "^1.15.6",
|
"follow-redirects": "^1.15.6",
|
||||||
|
|||||||
Submodule public/_locales updated: 7aad5d9fdc...b6bb85b7f7
@@ -293,7 +293,7 @@
|
|||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
transition: background-color 0.2s ease-in-out;
|
transition: background-color 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
.sbControlsMenu-item:hover {
|
.sbControlsMenu-item:hover, .sbControlsMenu-item:focus {
|
||||||
background-color: #444;
|
background-color: #444;
|
||||||
}
|
}
|
||||||
.sbControlsMenu-itemIcon {
|
.sbControlsMenu-itemIcon {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<div id="issueReporterImportExport" class="hidden">
|
<div id="issueReporterImportExport" class="hidden">
|
||||||
<div id="importExportButtons">
|
<div id="importExportButtons">
|
||||||
<button id="importSegmentsButton" title="__MSG_importSegments__">
|
<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>
|
||||||
<button id="exportSegmentsButton" class="hidden" title="__MSG_exportSegments__">
|
<button id="exportSegmentsButton" class="hidden" title="__MSG_exportSegments__">
|
||||||
<img src="/icons/export.svg" alt="Export icon" id="exportSegments" />
|
<img src="/icons/export.svg" alt="Export icon" id="exportSegments" />
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
<!-- Toggle Box -->
|
<!-- Toggle Box -->
|
||||||
<div class="sbControlsMenu">
|
<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">
|
<input type="checkbox" style="display: none" id="whitelistToggle">
|
||||||
<svg viewBox="0 0 24 24" width="23" height="23" class="SBWhitelistIcon sbControlsMenu-itemIcon">
|
<svg viewBox="0 0 24 24" width="23" height="23" class="SBWhitelistIcon sbControlsMenu-itemIcon">
|
||||||
<path d="M24 10H14V0h-4v10H0v4h10v10h4V14h10z" />
|
<path d="M24 10H14V0h-4v10H0v4h10v10h4V14h10z" />
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
<span id="unwhitelistChannel" style="display: none">__MSG_removeFromWhitelist__</span>
|
<span id="unwhitelistChannel" style="display: none">__MSG_removeFromWhitelist__</span>
|
||||||
</label>
|
</label>
|
||||||
<!--github: mbledkowski/toggle-switch-->
|
<!--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">
|
<span class="toggleSwitchContainer-switch">
|
||||||
<input type="checkbox" style="display: none" id="toggleSwitch" checked>
|
<input type="checkbox" style="display: none" id="toggleSwitch" checked>
|
||||||
<span class="switchBg shadow"></span>
|
<span class="switchBg shadow"></span>
|
||||||
|
|||||||
@@ -2617,23 +2617,13 @@ async function handleKeybindVote(type: number): Promise<void>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addHotkeyListener(): void {
|
function addHotkeyListener(): void {
|
||||||
document.addEventListener("keydown", hotkeyListener);
|
document.addEventListener("keydown", hotkeyListener, true);
|
||||||
|
document.addEventListener("keyup", hotkeyPropagationListener, true);
|
||||||
|
|
||||||
const onLoad = () => {
|
addCleanupListener(() => {
|
||||||
// Allow us to stop propagation to YouTube by being deeper
|
document.body.removeEventListener("keydown", hotkeyListener, true);
|
||||||
document.removeEventListener("keydown", hotkeyListener);
|
document.body.removeEventListener("keyup", hotkeyPropagationListener, true);
|
||||||
document.body.addEventListener("keydown", hotkeyListener);
|
});
|
||||||
|
|
||||||
addCleanupListener(() => {
|
|
||||||
document.body.removeEventListener("keydown", hotkeyListener);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
if (document.readyState === "complete") {
|
|
||||||
onLoad();
|
|
||||||
} else {
|
|
||||||
document.addEventListener("DOMContentLoaded", onLoad);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hotkeyListener(e: KeyboardEvent): void {
|
function hotkeyListener(e: KeyboardEvent): void {
|
||||||
@@ -2663,7 +2653,7 @@ function hotkeyListener(e: KeyboardEvent): void {
|
|||||||
const downvoteKey = Config.config.downvoteKeybind;
|
const downvoteKey = Config.config.downvoteKeybind;
|
||||||
|
|
||||||
if (keybindEquals(key, skipKey)) {
|
if (keybindEquals(key, skipKey)) {
|
||||||
if (activeSkipKeybindElement) {
|
if (activeSkipKeybindElement && !(activeSkipKeybindElement instanceof SkipButtonControlBar)) {
|
||||||
activeSkipKeybindElement.toggleSkip.call(activeSkipKeybindElement);
|
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.
|
* Adds the CSS to the page if needed. Required on optional sites with Chrome.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user