您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Change the window title on YouTube based on the channel name and video title
当前为
// ==UserScript== // @name YouTube Title Formatter Artist - Title // @description Change the window title on YouTube based on the channel name and video title // @version 0.1 // @namespace itsafeature.org // @license unlicense // @author Geoffrey De Belie (Smile4ever) // @match https://www.youtube.com/watch?v=* // @grant none // ==/UserScript== (function() { 'use strict'; // Function to update the title function updateTitle() { // Get the channel name from the anchor element const channelElement = document.querySelector('a.yt-simple-endpoint.style-scope.yt-formatted-string'); // Get the video title const videoTitleElement = document.querySelector('#above-the-fold #title'); if (channelElement && videoTitleElement) { const channelName = channelElement.innerText.split(' - ')[0]; const videoTitle = videoTitleElement.innerText; // Set the window title to "Channel Name - Video Title - YouTube" document.title = `${channelName} - ${videoTitle} - YouTube`; } } // Wait for the page content to load before running the updateTitle function window.addEventListener('load', updateTitle); // Optionally, observe changes in the page if the title might update after load const observer = new MutationObserver(updateTitle); observer.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址