您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirect YouTube pages to the old design
当前为
// ==UserScript== // @name YouTube Polymer Disable // @namespace https://github.com/davidbailey95 // @version 0.1.2 // @description Redirect YouTube pages to the old design // @author /u/ndogw and davidbailey95 // @match *://www.youtube.com/* // @exclude *://www.youtube.com/embed/* // @grant none // ==/UserScript== function changeUrl(url, always) { if (url.indexOf("disable_polymer") === -1) { if (url.indexOf("?") > 0) { url += "&"; } else { url += "?"; } url += "disable_polymer=1"; window.location.href = url; } if (always) { window.location.href = url; } } var url = window.location.href; changeUrl(url); // from https://stackoverflow.com/a/12552017/4247209 document.body.onclick = function(e){ e = e || event; var from = findParent('a',e.target || e.srcElement); if (from) { var url = from.href; if (!(url.match("/embed/") || url === location.href)) { changeUrl(url, true); return false; } } }; //find first parent with tagName [tagname] function findParent(tagname,el){ while (el){ if ((el.nodeName || el.tagName).toLowerCase()===tagname.toLowerCase()){ return el; } el = el.parentNode; } return null; }