您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Change XKCD/what-if image alt text to captions and show reference text inline (and don't hide on click)
// ==UserScript== // @name XKCD Print Titles // @namespace http://tampermonkey.net/ // @version 0.1 // @description Change XKCD/what-if image alt text to captions and show reference text inline (and don't hide on click) // @author You // @match https://*.xkcd.com/* // @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; // Your code here... var img = document.querySelectorAll('#comic img'); if(img.length === 0) img = document.querySelectorAll('.entry img'); img.forEach(function(element) { var title = element.title; if(title !== undefined) { var p = document.createElement('p'); p.style.textAlign = 'center'; p.style.lineHeight = 1.5; p.style.backgroundColor = '#ccc'; p.style.padding = 5; p.innerHTML = `<span style="padding: 5px">${title}</span>`; element.parentNode.insertBefore(p, element.nextSibling); } }); var ref = document.querySelectorAll('article .ref'); ref.forEach(function(element) { var refBody = element.querySelector(':scope .refbody'); refBody.style.position = 'relative'; refBody.style.display = 'inline-block'; refBody.style.left = 0; refBody.style.bottom = 0; refBody.style.overflow = 'visible'; }); jQuery('.refnum').prop('onclick', null).off('click'); jQuery('body').prop('onclick', null).off('click');
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址