This commit is contained in:
Michael C 2022-04-08 22:36:44 -04:00
parent 88f60c0e84
commit 0d34e643c7
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4
2 changed files with 10 additions and 3 deletions

View file

@ -652,4 +652,10 @@ input::-webkit-inner-spin-button {
.sponsorBlockCategoryPill:hover .categoryPillClose {
display: inherit;
}
/* tweak for mobile duration */
#sponsorBlockDurationAfterSkips.ytm-time-display {
padding-left: 4px;
margin: 0px;
}

View file

@ -2126,14 +2126,15 @@ function updateAdFlag(): void {
}
function showTimeWithoutSkips(skippedDuration: number): void {
if (onMobileYouTube || onInvidious) return;
if (onInvidious) return;
if (isNaN(skippedDuration) || skippedDuration < 0) {
skippedDuration = 0;
}
// YouTube player time display
const display = document.querySelector(".ytp-time-display.notranslate");
const displayClass = onMobileYouTube ? "ytm-time-display" : "ytp-time-display.notranslate"
const display = document.querySelector(`.${displayClass}`);
if (!display) return;
const durationID = "sponsorBlockDurationAfterSkips";
@ -2143,7 +2144,7 @@ function showTimeWithoutSkips(skippedDuration: number): void {
if (duration === null) {
duration = document.createElement('span');
duration.id = durationID;
duration.classList.add("ytp-time-duration");
duration.classList.add(displayClass);
display.appendChild(duration);
}