您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
我看不懂日文标题啊!
当前为
// ==UserScript== // @name Bangumi/bgm.tv 显示中文标题 // @namespace http://tampermonkey.net/ // @version 0.41 // @description 我看不懂日文标题啊! // @author Marsen // @match http*://bgm.tv/* // @match http*://bangumi.tv/* // @match http*://chii.in/* // @icon https://bgm.tv/img/favicon.ico // @grant GM_addStyle // @run-at document-start // ==/UserScript== (function () { 'use strict'; let pathname = document.location.pathname; // 动画详情页:替换H1大标题,保留小字号原标题,话数按钮样式调节 if (pathname.startsWith("/subject") || pathname.startsWith("/ep")) { // prg_list css GM_addStyle(` a.epBtnUnknown, a.epBtnWatched, a.epBtnAir, a.epBtnNA, a.epBtnQueue, a.epBtnToday, a.epBtnDrop { border: 1px solid #0000; border-radius: 2px; font-size: 1.3em !important; } a.epBtnUnknown:hover, a.epBtnWatched:hover, a.epBtnAir:hover, a.epBtnNA:hover, a.epBtnQueue:hover, a.epBtnToday:hover, a.epBtnDrop:hover { background-color: orange; color: white; border: 1px solid #0000; } ul.prg_list a:hover { padding: 2px; -webkit-transform: scale(1.1); } ul.prg_list a, ul.prg_list a:active, ul.prg_list a:visited { padding: 2px; margin: 0 4px 6px 0; } `); // 监听document载入状态 let stateCheck = setInterval(() => { if (document.readyState === 'interactive') { clearInterval(stateCheck); let h1Title = document.querySelector("#headerSubject > h1 > a"); if (h1Title.title != "") { let originalTitle = document.createElement("small"); originalTitle.innerText = h1Title.text + " "; h1Title.parentNode.insertBefore(originalTitle, h1Title.nextElementSibling) h1Title.text = h1Title.title; } } }, 100); } // 登录后首页:替换进度管理标题,按钮样式调节 else if (pathname == "/") { /* tinyMode css */ GM_addStyle(` /* hide prgsPercentNum */ #prgsPercentNum { display: none; } /* prg button */ [id^='prg_'] { border: 1px solid #0000 !important; border-radius: 2px; } ul.prg_list { padding-top: 0.3em; line-height: 100%; } /* prg button hover */ .tinyMode ul.prg_list a:hover { padding: 2px 2px; background-color: orange; color: white; -webkit-transform: scale(1.1); } `) /* blockMode css */ GM_addStyle(` a.epBtnUnknown:hover, a.epBtnWatched:hover, a.epBtnAir:hover, a.epBtnNA:hover, a.epBtnQueue:hover, a.epBtnToday:hover, a.epBtnDrop:hover { background-color: orange; color: white; } ul.prg_list a:hover { padding: 3px 2px; } `); // 监听document载入状态 let stateCheck = setInterval(() => { if (document.readyState === 'interactive') { clearInterval(stateCheck); // 检测登录状态 let h1 = document.querySelector("#header > h1"); if (h1 != null && h1.textContent.startsWith("Hi")) { /* tinyMode */ let tinyModeTitles = document.querySelectorAll("[id^='subjectPanel'] > div.epGird > div > a:nth-last-of-type(1)"); tinyModeTitles.forEach(function (t) { t.innerText = t.attributes["data-original-title"].value; // 作品标题字号放大 t.style.fontSize = "1.15em"; // t.style.fontWeight = "bold"; }); let prgLists = document.querySelectorAll("[id^='subjectPanel'] > div.epGird > ul"); prgLists.forEach(function (t) { t.style.paddingTop = "0.3em" }); /* blockMode */ let blockModeTitles = document.querySelectorAll("[id^='subjectPanel'] > div.header.clearit > div > h3 > a"); blockModeTitles.forEach(function (t) { t.text = t.attributes["data-original-title"].value; }); let blockModeLeftTitles = document.querySelectorAll("#prgSubjectList li a.subjectItem.title.textTip"); blockModeLeftTitles.forEach(function (t) { t.querySelector("span").innerHTML = t.attributes["data-original-title"].value; }); } } }, 100); } })();