// ==UserScript== // @name Bilibili 旧播放页 // @namespace https://greasyfork.org/zh-CN/scripts/394296 // @version 2.4.0 // @description 切换旧版播放页面,布局、播放器全部切换回2019年12月09日之前的样子。载入异常请尝试`Shift+F5`或`Ctrl+Shift+R` // @author Motoori Kashin // @match *://*.bilibili.com/* // @license MIT // @run-at document-start // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; const OR_HTML = document.getElementsByTagName("head")[0].innerHTML; let path = document.location.href.split('/'); function xhrHM(url){ // 同步链接获取网页数据 const xhr = new XMLHttpRequest(); xhr.open('GET', url, false); xhr.send(null); if (xhr.status === 200) {return xhr.responseText;} } function xhrYM(url){ // 异步链接获取网页数据 const xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.onload = () => {return xhr.responseText;} xhr.send(); } /*function adscr(src){ // 添加同步script let script = document.createElement("script"); script.setAttribute("type","text/javascript"); script.setAttribute("src",src); document.body.appendChild(script); } function anscr(src){ // 添加异步script 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.getElementsByClassName(ele)[0]; let rpw = document.createElement(ele); rpw.innerHTML = dcm; rp.replaceWith(rpw); } function onPlay(){ // 动态添加av页播放器初始化代码 let bofqi = document.getElementById("bofqi"); let str = ''; var range = document.createRange() range.setStart(bofqi, 0) bofqi.appendChild( range.createContextualFragment(str) ) }*/ function wrAV(){ // 处理av页 let ini = xhrHM(location.href).match(/' + ini + '