mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 05:57:07 +03:00
Show time with skips removed on invidious
This commit is contained in:
@@ -2375,14 +2375,15 @@ function updateAdFlag(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showTimeWithoutSkips(skippedDuration: number): void {
|
function showTimeWithoutSkips(skippedDuration: number): void {
|
||||||
if (isOnInvidious()) return;
|
|
||||||
|
|
||||||
if (isNaN(skippedDuration) || skippedDuration < 0) {
|
if (isNaN(skippedDuration) || skippedDuration < 0) {
|
||||||
skippedDuration = 0;
|
skippedDuration = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// YouTube player time display
|
// YouTube player time display
|
||||||
const displayClass = isOnMobileYouTube() ? "ytm-time-display" : "ytp-time-display.notranslate"
|
const displayClass =
|
||||||
|
isOnInvidious() ? "vjs-duration" :
|
||||||
|
isOnMobileYouTube() ? "ytm-time-display" :
|
||||||
|
"ytp-time-display.notranslate";
|
||||||
const display = document.querySelector(`.${displayClass}`);
|
const display = document.querySelector(`.${displayClass}`);
|
||||||
if (!display) return;
|
if (!display) return;
|
||||||
|
|
||||||
@@ -2393,7 +2394,7 @@ function showTimeWithoutSkips(skippedDuration: number): void {
|
|||||||
if (duration === null) {
|
if (duration === null) {
|
||||||
duration = document.createElement('span');
|
duration = document.createElement('span');
|
||||||
duration.id = durationID;
|
duration.id = durationID;
|
||||||
duration.classList.add(displayClass);
|
if (!isOnInvidious()) duration.classList.add(displayClass);
|
||||||
|
|
||||||
display.appendChild(duration);
|
display.appendChild(duration);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user