Greasy Fork

Greasy Fork is available in English.

test

为微信阅读pc版添加自动滚动和翻页功能

当前为 2022-12-02 提交的版本,查看 最新版本

// ==UserScript==
// @name         test
// @namespace    http://tampermonkey.net/
// @version      0.3.3
// @description  为微信阅读pc版添加自动滚动和翻页功能
// @author       DearCyan
// @runat        document-end
// @grant        none
// @match        https://www.bilibili.com/*
// @match        https://tieba.baidu.com/*
// @match        https://www.taobao.com/*
// @match        https://www.zhihu.com/*
// @match        https://mihoyo.com/*
// @match        https://bbs.mihoyo.com/*
// @match        https://www.miyoushe.com/*
// @icon         https://cdn-icons-png.flaticon.com/512/747/747062.png
// @grant        none
// @license      GPL
// ==/UserScript==


console.log('anti_gray')

function anti_gray() {
    const url = window.location.href

    // bilibili
    if (/bilibili.com/.test(url)) {
        addStyle()
        removeClass('gray')
    }

    //tieba
    if (/tieba.baidu.com/.test(url)) {
        addStyle()
        removeClass('tb-allpage-filter')
    }
}
//method

function removeClass(className) {
    console.debug('remove class: ' + className)
    let htmlClass = document.documentElement.classList
    const arr = Array.from(htmlClass)
    const res = arr.filter(item => item !== className)
    htmlClass = res
}

function addStyle() {
    console.debug('reset filter')
    const html = document.documentElement
    const body = document.body
    html.style.filter = 'none'
    body.style.filter = 'none'
}

window.onload = anti_gray

anti_gray()