// ==UserScript== // @name Prevent autoplayed featured videos on YouTube channel profile pages // @description Prevent autoplayed featured videos on YouTube channel profile pages. // @name:zh arXiv下载PDF文件自动重命名为论文名 // @description:zh 能够直接把下载的文件名默认修改为论文名,并且符合Windows文件命名规范。会在搜索页面以及单个论文界面产生一个下载论文的超链接,点击即可。[2023-12-17修改版] // @name:zh-CN arXiv下载PDF文件自动重命名为论文名 // @description:zh-CN 能够直接把下载的文件名默认修改为论文名,并且符合Windows文件命名规范。会在搜索页面以及单个论文界面产生一个下载论文的超链接,点击即可。[2023-12-17修改版] // @name:zh-HK arXiv下載PDF檔案自動重新命名為論文名 // @description:zh-HK 可以直接將下載的檔案名預設改為論文名,並符合Windows檔案命名規範。喺搜索頁面同單篇論文介面會產生一個下載論文的超連結,按一下即可。[2023-12-17修改版] // @name:zh-SG arXiv下载PDF文件自动重命名为论文名 // @description:zh-SG 能够直接把下载的文件名默认修改为论文名,并且符合Windows文件命名规范。会在搜索页面以及单个论文界面产生一个下载论文的超链接,点击即可。[2023-12-17修改版] // @name:zh-TW arXiv下載PDF檔案自動重新命名為論文名 // @description:zh-TW 能夠直接將下載的檔案名稱預設修改為論文名稱,且符合Windows檔案命名規範。將在搜尋頁面以及單篇論文介面產生一個下載論文的超連結,點擊即可。[2023-12-17修改版] // @name:en arXiv PDF Download with Automatic Renaming to Paper Title // @description:en Allows directly renaming the downloaded file to the paper title, compliant with Windows file naming conventions. Adds a hyperlink to download the paper on the search page and individual paper interface, just click to download. [Modified version 12/17/2023] // @name:ja YouTubeチャンネルプロフィールページでの注目の動画の自動再生を防ぐ // @description:ja YouTubeチャンネルプロフィールページでの注目の動画の自動再生を防ぐ。 // @name:ko YouTube 채널 프로필 페이지에서 추천 동영상의 자동 재생 방지 // @description:ko YouTube 채널 프로필 페이지에서 추천 동영상의 자동 재생 방지. // @name:ru Предотвращение автоматического воспроизведения избранных видео на страницах профилей каналов YouTube // @description:ru Предотвращение автоматического воспроизведения избранных видео на страницах профилей каналов YouTube. // @namespace http://tampermonkey.net/ // @version 1.3.1.1 // @author aspen138 // @match https://www.youtube.com/@*/featured // @match https://www.youtube.com/@* // @match https://www.youtube.com/* // @exclude https://www.youtube.com/watch?v=* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Function to pause the video function pauseVideo() { const video = document.querySelector('video'); if (video && !video.paused) { video.pause(); //console.log('YouTube autoplay video paused.'); } } // Function to bold and highlight the specified element and its children function highlightElement() { const element = document.querySelector('.page-header-view-model-wiz__page-header-content-metadata'); if (element) { element.style.backgroundColor = 'yellow'; // Highlight with yellow background // Bold and mimic the style for each child Array.from(element.children).forEach(child => { child.style.fontWeight = 'bold'; // Make each child bold child.style.color = 'red'; // Set font color to red child.style.textDecoration = 'none'; // Remove any text decoration if needed }); // Also, bold and mimic styles for any spans inside the children const spans = element.querySelectorAll('span'); spans.forEach(span => { span.style.fontWeight = 'bold'; span.style.color = 'red'; // Set font color to red span.style.textDecoration = 'none'; // Remove any text decoration }); //console.log('Element and its children highlighted and bolded with red font color.'); } } // Create a MutationObserver to monitor for video elements const observer = new MutationObserver((mutations) => { pauseVideo(); highlightElement(); }); // Start observing the document body for changes observer.observe(document.body, { childList: true, subtree: true }); // Attempt to pause the video and highlight the element immediately in case they're already there pauseVideo(); highlightElement(); // Counter for setInterval executions let executionCount = 0; // Use setInterval to repeatedly check for the element and apply styles const intervalId = setInterval(() => { highlightElement(); executionCount++; // Clear the interval after two executions if (executionCount >= 2) { clearInterval(intervalId); } }, 1000); // Check every 1000 milliseconds (1 second) })();