您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
打印时只展示唐诗宋词内容并调整字体大小
// ==UserScript== // @name 汉典诗词-打印唐诗宋词 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 打印时只展示唐诗宋词内容并调整字体大小 // @author You // @match http://sc.zdic.net/* // @icon https://www.google.com/s2/favicons?sz=64&domain=zdic.net // @grant none // @license mit // ==/UserScript== (function() { 'use strict'; const style = document.createElement('style') const head = document.head || document.getElementsByTagName('head')[0] style.type = 'text/css' const cssText = ` @media print { body { visibility: hidden; } #mbnr { visibility: visible; } #mbnr { position: fixed; width: 100%; height: 100%; top: 0; left: 0; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; } #mbnr > * { display: none; } #mbnr #scbt, #mbnr #sc1 { display: block; } #scbt, #scxx, #scnr, #scnr p { line-height: 2; } #scbt { font-size: 40px; } #scxx { font-size: 30px; } #scnr, #scnr p { font-size: 36px; } } ` const textNode = document.createTextNode(cssText); style.appendChild(textNode); head.appendChild(style); //把创建的style元素插入到head中 })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址