I Built a Safari Extension That Shows When Your YouTube Video Ends
A developer created a Safari extension that displays the end time of YouTube videos. The extension integrates seamlessly with YouTube's interface, showing the end time alongside the current video time. It also includes features to ensure the end time updates correctly as users navigate between videos.
- ▪The extension calculates the end time by determining the remaining seconds of the video and adding it to the current time.
- ▪It injects a new element into YouTube's player to display the end time without altering the existing styles.
- ▪The developer used event listeners and a MutationObserver to ensure the end time updates reliably during video navigation.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3944941) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Fluphies Posted on May 21 I Built a Safari Extension That Shows When Your YouTube Video Ends #safari #javascript #webextensions #tutorial Ever put on a YouTube video and wondered if you'll finish it before you have to leave, go to sleep, or get back to work? I had that thought one too many times, so I built a small Safari extension to solve it. It adds the end time directly inside YouTube's native time bubble: 0:20 / 7:23 · ends 11:44pm That's it. Simple, but surprisingly useful.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).