// ==UserScript== // @name Bilibili 旧播放页 // @namespace https://greasyfork.org/zh-CN/scripts/394296 // @version 2.3.3 // @description 切换旧版播放页面,布局、播放器全部切换回2019年12月09日之前的样子。 // @author Motoori Kashin // @match *://*.bilibili.com/video/av* // @match *://*.bilibili.com/watchlater/* // @match *://*.bilibili.com/bangumi/play/ss* // @match *://*.bilibili.com/bangumi/play/ep* // @license MIT // @run-at document-start // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; const OR_HTML = document.getElementsByTagName("head")[0].innerHTML; const NTR = '
'; const path = location.pathname.match(/(?<=\/).*?(?=\/)/)[0]; function adscr(src){ let script = document.createElement("script"); script.setAttribute("type","text/javascript"); script.setAttribute("src",src); document.body.appendChild(script); } function anscr(src){ let script = document.createElement("script"); script.setAttribute("src",src); script.setAttribute("crossorigin",""); script.setAttribute("defer","defer"); document.body.appendChild(script); } function repEle(ele,dcm){ let rp = document.getElementsByTagName(ele)[0]; let rpw = document.createElement(ele); rpw.innerHTML = dcm; rp.replaceWith(rpw); } function onPlay(){ let bofqi = document.getElementById("bofqi"); let str = ''; var range = document.createRange() range.setStart(bofqi, 0) bofqi.appendChild( range.createContextualFragment(str) ) } function wrAV(){ let head = OR_HTML.match(/.*?(?='; let html = '' + head + '' + body + ''; document.open(); document.write(html); document.close(); } function wrWL(){ let head = ''; let body = '' let html = '' + head + '' + body + ''; document.open(); document.write(html); document.close(); } function wrBGM(){ repEle("html",NTR); let head = OR_HTML.match(/.*?ico\"\>/)[0]; let body = '' head = head + ''; document.getElementsByTagName("head")[0].innerHTML = head; document.getElementsByTagName("body")[0].innerHTML = body; new adscr("//static.hdslb.com/js/jquery.min.js"); new adscr("//static.hdslb.com/js/video.min.js"); new adscr("//static.hdslb.com/vip/dist/js/vipPlugin.v2.js"); new adscr("//static.hdslb.com/js/promise.auto.min.js"); new adscr("//s1.hdslb.com/bfs/seed/jinkela/header/header.js"); new anscr("//s1.hdslb.com/bfs/static/bangumi/play/1.bangumi-play.764aaa07c8ac8078b639306b18838d080a1cefc1.js"); new anscr("//s1.hdslb.com/bfs/static/bangumi/play/bangumi-play.764aaa07c8ac8078b639306b18838d080a1cefc1.js"); new adscr("//static.hdslb.com/common/js/footer.js"); //let head = OR_HTML.match(/.*?ico\"\>/)[0]; //let INITIAL_STATE = ''; //let body = '' + INITIAL_STATE + '' //head = head + ''; //let html = '' + head + '' + body + ''; //document.open(); //document.write(html); //document.close(); } let obj = { 'video' : () => { if (OR_HTML.match(/biliconfig/) == null){new wrAV();} let reh = setInterval(function(){ let reHead = document.getElementsByClassName("bili-header-m"); if (reHead[1]){ reHead[1].remove(); document.getElementById("bofqi").removeAttribute("style"); document.getElementById("entryNew").setAttribute("style","visibility: hidden;"); clearInterval(reh); } }, 10); }, 'watchlater' : () => { new wrWL(); }, 'bangumi' : () => { if (OR_HTML.match(/出错/) == null){new wrBGM();} let reh = setInterval(function(){ let entryNew = document.getElementsByClassName("new-entry")[0]; if (entryNew){ entryNew.setAttribute("style","visibility: hidden;"); clearInterval(reh); } }, 10); } } obj[path](); let cdm = setInterval(function(){ let dmList = document.getElementsByClassName("bilibili-player-filter-btn")[1]; if (dmList){ dmList.click(); clearInterval(cdm); } }, 10); })();