🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/06 12:47:55
🔄 下次更新时间:2026/01/06 13:47:55
手动刷新缓存

古诗文网增强

屏蔽古诗文网登录弹窗,移除阅读页全部广告,自动展开折叠的文本(可选择仅展开译文或全部展开),一键折叠全部文本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         古诗文网增强
// @namespace    https://github.com/tfia
// @version      0.5
// @description  屏蔽古诗文网登录弹窗,移除阅读页全部广告,自动展开折叠的文本(可选择仅展开译文或全部展开),一键折叠全部文本
// @author       RhDu
// @match        https://so.gushiwen.cn/*
// @icon         https://www.google.com/s2/favicons?domain=https://so.gushiwen.cn
// @require      https://cdn.bootcdn.net/ajax/libs/sweetalert2/11.7.27/sweetalert2.all.min.js
// @grant        GM_registerMenuCommand
// @grant        GM_unregisterMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_notification
// ==/UserScript==
 
var id;
var isTranslationOnly = GM_getValue("isTranslationOnly", false);
 
function registerMenuCommand()
{
    if(isTranslationOnly == false) id=GM_registerMenuCommand("❌ 仅自动展开译文", reverseTranslation, "t");
    else id=GM_registerMenuCommand("✅ 仅自动展开译文", reverseTranslation, "t");
}
 
function reverseTranslation()
{
    GM_setValue("isTranslationOnly", !isTranslationOnly);
    isTranslationOnly = GM_getValue("isTranslationOnly", false);
    GM_unregisterMenuCommand(id);
    registerMenuCommand();
    Swal.fire
    ({
        toast: true,
        position: 'top-right',
        iconColor: '#f8bb86',
        showConfirmButton: false,
        timer: 1500,
        timerProgressBar: true,
        icon: 'success',
        title: '操作成功 刷新页面生效'
    })
}
 
function foldAll()
{
    for(var i=0;i < $("a:contains(▲)").length;i++) $("a:contains(▲)")[i].click();
    Swal.fire
    ({
        toast: true,
        position: 'top-right',
        showConfirmButton: false,
        timer: 1500,
        timerProgressBar: true,
        icon: 'success',
        title: '已全部折叠'
    })
}
 
(function()
{
    'use strict';
    getCookie = function(name) {return "hook";}; // hook 登录检测函数
    //添加菜单选项
    registerMenuCommand();
    GM_registerMenuCommand("#️⃣ 一键折叠所有内容", foldAll, "f");
    //移除登录弹窗
    var object = $("#hide-center2")[0];
    if (object != null) object.parentNode.removeChild(object);
    //消除侧边广告
    $(".right")[1].remove();
    //消除底部广告
    $('#btmwx').remove();
    //自动展开所有折叠的文本
    if(isTranslationOnly == true) $("a:contains(展开)")[0].click();
    else for(var i=0;i < $("a:contains(展开)").length;i++) $("a:contains(展开)")[i].click();
})();