小林coding - 解锁阅读全文

解锁阅读全文

// ==UserScript==
// @name         小林coding - 解锁阅读全文
// @namespace    http://tampermonkey.net/
// @description  解锁阅读全文
// @version      1.0.0
// @author       L
// @match        *://*.xiaolincoding.com/*
// @license      GNU GPLv3
// ==/UserScript==

'use strict';

function patch() {
    const readmoreContainer = document.querySelector('#readmore-container');
    if (readmoreContainer) {
        readmoreContainer.style.height = 'auto';
        Object.defineProperty(readmoreContainer.style, 'height', {
            set: () => {}
        });
    }

    const readmoreWrapper = document.querySelector('#readmore-wrapper');
    if (readmoreWrapper) {
        readmoreWrapper.remove();
    }
}

const observer = new ResizeObserver((entries) => patch());

function observe() {
    observer.disconnect();

    const target = document.querySelector('main.page div');
    if (!target) return;

    observer.observe(target);
}

window.navigation.addEventListener('navigate', observe);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址