Add ar5iv Links to arXiv

Automatically adds ar5iv links to arXiv paper pages for easier HTML viewing.

  1. // ==UserScript==
  2. // @name Add ar5iv Links to arXiv
  3. // @name:en Add ar5iv Links to arXiv
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.0.1
  6. // @description:en Automatically adds ar5iv links to arXiv paper pages for easier HTML viewing.
  7. // @description:ja arXiv論文ページにar5ivリンクを自動追加し、HTMLでの閲覧を容易にします。
  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 links to arXiv paper pages for easier HTML viewing.
  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 li = document.createElement("li");
  21. const a = document.createElement("a");
  22. a.href = window.location.href.replace("arxiv", "ar5iv");
  23. a.textContent = "HTML (ar5iv)";
  24. li.appendChild(a);
  25.  
  26. ul.insertBefore(li, ul.children[3]);
  27. })();