您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Open videos in a playlist by themselves by removing the &list parameter from links.
// ==UserScript== // @name Youtube Playlist Nullifier // @namespace Amaroq64 // @version 0.1 // @description Open videos in a playlist by themselves by removing the &list parameter from links. // @author Amaroq // @match https://www.youtube.com/playlist* // @icon https://www.youtube.com/favicon.ico // @grant none // @run-at document-idle // ==/UserScript== (function() { 'use strict'; function cleanLinks() { //Duplicate IDs on the same page are invalid html, but youtube does it anyway. //However, this is probably the most reliable way to get the correct links. let links = document.querySelectorAll('a#video-title'); for (let link = 0; link < links.length; link++) { //Keep everything before the first &. //A simple split will do. if(!links[link].dataset.cleaned) { links[link].href = links[link].href.split('&')[0]; links[link].dataset.cleaned = 'true'; } } } var observer = new MutationObserver(cleanLinks); observer.observe(document.body, { childList: true, subtree: true }); })();