mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 15:07:02 +03:00
Added different ui option
This commit is contained in:
@@ -1622,6 +1622,25 @@ function hideSponsorTime(barTimes) {
|
|||||||
skipDuration += time.segment[1] - time.segment[0];
|
skipDuration += time.segment[1] - time.segment[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
let times = document.getElementsByClassName("ytp-time-display notranslate")[0].getElementsByTagName("span");
|
let display = document.getElementsByClassName("ytp-time-display notranslate")[0];
|
||||||
times[2].innerText = formatTime(video.duration - skipDuration);
|
if (display === undefined) return
|
||||||
|
|
||||||
|
if(Config.config.hideRealTime) {
|
||||||
|
return display.getElementsByTagName("span")[2].innerText = formatTime(video.duration - skipDuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
const durationID = "durationAfterSkips";
|
||||||
|
let duration;
|
||||||
|
|
||||||
|
|
||||||
|
duration = document.getElementById(durationID);
|
||||||
|
|
||||||
|
// Create span if needed
|
||||||
|
if(duration === null) {
|
||||||
|
duration = document.createElement('span');
|
||||||
|
duration.id = durationID;
|
||||||
|
display.appendChild(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
duration.innerText = " ("+formatTime(video.duration - skipDuration)+")";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user