Greasy Fork

来自缓存

Greasy Fork is available in English.

干扰码清除器

清除网页中隐藏的干扰码,便于内容复制和阅读模式下阅读。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         干扰码清除器
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  清除网页中隐藏的干扰码,便于内容复制和阅读模式下阅读。
// @author       Mr.Po
// @match        http*://*/thread*
// @match        http*://*/forum.php*
// @match        https://*/showpaperword?action=showbook&actmode=showpaper*
// @match        https://www.lightnovel.us/cn/detail/*
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';

    /*jshint esversion: 8 */

    // 干扰码处理器数组
    const jammerCodeHandlers = [];

    // 普通BBS论坛 - 样式干扰码
jammerCodeHandlers.push({
    support: url => url.indexOf('thread') > -1 || url.indexOf('forum.php') > -1,
    handle: () => $('.jammer').remove()
});

// 普通BBS论坛 - 隐藏块干扰码
jammerCodeHandlers.push({
    support: url => url.indexOf('thread') > -1 || url.indexOf('forum.php') > -1,
    handle: () => $("#postlist span[style=\"display:none\"]").remove()
});

// 海棠文化小说站
jammerCodeHandlers.push({
    support: url => url.indexOf('showpaperword?action=showbook&actmode=showpaper') > -1,
    handle: () => {

        // 当此节点被插入内容时
        $("#readpagewidth").on('DOMNodeInserted', function() {

            // 移除指定节点
            $(this).find("font.OutStrRnds").remove();
        });
    }
});

// 轻之国度 小说站
jammerCodeHandlers.push({
    support: url => url.indexOf('www.lightnovel.us/cn/detail/') > -1,
    handle: () => {

        // 注册根节点拷贝事件
        document.oncopy = e => {

            let content;
            try {
                content = document.selection.createRange().text;
            } catch (t) {
                content = window.getSelection().toString();
            }

            const clipboardData = window.clipboardData || e.clipboardData;

            clipboardData.setData("Text", content);
        };
    }
});


    const url = window.location.href;
    jammerCodeHandlers.filter(it=>it.support(url)).forEach(it => it.handle());
})();