// ==UserScript== // @name Audio Tab Title // @description Change the window title on YouTube based on the channel name and video title, and append "- Spotify" to the title on Spotify pages. // @version 0.2.1 // @namespace itsafeature.org // @author Geoffrey De Belie (Smile4ever) // @license Unlicense // @match https://www.youtube.com/watch?v=* // @match https://open.spotify.com/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Function to update the title on YouTube function updateYouTubeTitle() { const channelElement = document.querySelector('a.yt-simple-endpoint.style-scope.yt-formatted-string'); const videoTitleElement = document.querySelector('#above-the-fold #title'); if (channelElement && videoTitleElement) { const channelName = channelElement.innerText.split(' - ')[0]; const videoTitle = videoTitleElement.innerText; if(videoTitle.includes(" - ")) return; // Set the window title for YouTube document.title = `${channelName} - ${videoTitle} - YouTube`; } } // Function to update the title on Spotify function updateSpotifyTitle() { const titleElement = document.querySelector('title'); // Get the