arXiv enhanced

Automatically adds ar5iv and alphaXiv links to arXiv paper pages.

  1. // ==UserScript==
  2. // @name arXiv enhanced
  3. // @name:en arXiv enhanced
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.1.0
  6. // @description:en Automatically adds ar5iv and alphaXiv links to arXiv paper pages.
  7. // @description:ja arXiv論文ページにar5iv及びalphaXivリンクを自動追加します。
  8. // @author sho9029
  9. // @match https://arxiv.org/abs/*
  10. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  11. // @grant none
  12. // @license MIT
  13. // @description Automatically adds ar5iv and alphaXiv links to arXiv paper pages.
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. const ul = document.querySelector("#abs-outer > div.extra-services > div.full-text > ul");
  20. const li1 = document.createElement("li");
  21. const a1 = document.createElement("a");
  22. a1.href = window.location.href.replace("arxiv", "ar5iv");
  23. a1.textContent = "HTML (ar5iv)";
  24. li1.appendChild(a1);
  25. const li2 = document.createElement("li");
  26. const a2 = document.createElement("a");
  27. a2.href = window.location.href.replace("arxiv", "alphaxiv");
  28. a2.textContent = "alphaXiv";
  29. li2.appendChild(a2);
  30.  
  31. ul.insertBefore(li1, ul.children[3]);
  32. ul.insertBefore(li2, ul.children[4]);
  33. })();