arXiv Clean Reader

Remove the top navigation bar, beta tag, and bottom right feedback prompt from the arXiv HTML article.

// ==UserScript==
// @name         arXiv Clean Reader
// @namespace    http://tampermonkey.net/
// @version      1.0
// @license MIT
// @description  Remove the top navigation bar, beta tag, and bottom right feedback prompt from the arXiv HTML article.
// @author       Naive
// @match        https://arxiv.org/html/*
// @match        https://arxiv.org/abs/*
// @icon         https://arxiv.org/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function cleanPage() {
        // header
        const header = document.querySelector('header');
        if (header) header.remove();

        // beta
        const observer = new MutationObserver(() => {
            const existingStyle = document.querySelector('style#custom-remove-after');
            if (!existingStyle) {
                const style = document.createElement('style');
                style.id = 'custom-remove-after';
                style.textContent = 'body::after { content: none !important; }';
                document.head.appendChild(style);
            }
        });
        observer.observe(document, {
            childList: true,
            subtree: true
        });

        // feedback
        const feedbackDiv = document.querySelector('#openForm');
        if (feedbackDiv) feedbackDiv.remove();

        //const footer = document.querySelector('footer');
        //if (footer) footer.remove();

        const mainContent = document.querySelector('.ltx_page_main');
        if (mainContent) {
            mainContent.style.marginTop = '0';
            mainContent.style.paddingTop = '20px';
        }
    }

    const observer = new MutationObserver((mutations) => {
        cleanPage();
    });

    observer.observe(document, {
        childList: true,
        subtree: true
    });

    // initial
    cleanPage();

    // resize
    window.addEventListener('resize', cleanPage);
})();

QingJ © 2025

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