arXiv HTML cleaner

Remove arXiv HTML annoying banner and report button.

Verze ze dne 30. 06. 2025. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         arXiv HTML cleaner
// @namespace    https://github.com/undefined443
// @version      0.0.2
// @description  Remove arXiv HTML annoying banner and report button.
// @author       undefined443
// @match        https://arxiv.org/html/*
// @match        https://arxiv.org/abs/*
// @icon         https://static.arxiv.org/static/browse/0.3.4/images/icons/favicon-32x32.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
  "use strict";
  function removeElement(query) {
    const element = document.querySelector(query);
    if (element) {
      element.remove();
    }
  }

  // Dynamically remove elements
  const observer = new MutationObserver((mutationsList) => {
    for (const mutation of mutationsList) {
      if (mutation.type === "childList") {
        removeElement(".desktop_header");
        removeElement(".package-alerts");
        removeElement("#openForm");
        removeElement("#small-report-button");
      }
    }
  });

  const config = { childList: true, subtree: true };
  observer.observe(document.body, config);

  // Static removal of elements
  removeElement(".desktop_header");  // Remove top banner at html page
  removeElement(".package-alerts");  // Remove package alerts at html page
  removeElement(".slider-wrapper");  // Remove top banner at abs page
  removeElement("#openForm");
  removeElement("#cu-identity");     // Remove Cornell University identity at abs page
})();