您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Display avid on video information header.
当前为
// ==UserScript== // @name 在视频信息区显示视频 av 号 // @namespace im.outv.userscripts.bilibili.avid // @version 0.2.0 // @description Display avid on video information header. // @author You // @match https://www.bilibili.com/video/* // @match https://*.bilibili.com/video/* // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; let afterStyleBlock; function createStyleBlock() { const style = document.createElement("style") document.body.appendChild(style) return style } function updateAvidDisplay(aid, bvid) { if (!aid) return if (!afterStyleBlock) { afterStyleBlock = createStyleBlock() } afterStyleBlock.innerText = `#viewbox_report .video-info-meta:after { content: "${bvid} av${aid}"; color: var(--text3); }` console.log("Updated", aid, bvid, afterStyleBlock) } function onStateUpdate(value) { console.log("State updated", value) updateAvidDisplay(window.__INITIAL_STATE__.aid, window.__INITIAL_STATE__.bvid) } if (typeof window.__INITIAL_STATE__ === "undefined") { window.__INITIAL_STATE__ = {}; } window.__INITIAL_STATE__ = new Proxy(window.__INITIAL_STATE__, { set(target, prop, value) { target[prop] = value; onStateUpdate(value); return true; } }); })();