HTML5 for arXiv

更便捷的访问HTML5论文!

目前为 2022-03-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name HTML5 for arXiv
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @name:zh-CN HTML5 for arXiv
  6. // @description An extension that makes html5 source available in arxiv.org based on the amazing ar5iv project.
  7. // @description:zh-cn 更便捷的访问HTML5论文!
  8. // @author AnCoSONG
  9. // @license MIT
  10. // @match https://arxiv.org/abs/*
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=arxiv.org
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. function setup() {
  18. try {
  19. var prefix = location.pathname
  20. var ul = document.querySelector('.full-text ul')
  21. var li = document.createElement('li')
  22. var a = document.createElement('a')
  23. a.href = 'https://ar5iv.org' + prefix
  24. a.innerText = 'HTML5(ar5iv)'
  25. a.className = 'abs-button'
  26. a.target = '_blank'
  27. li.appendChild(a)
  28. ul.appendChild(li)
  29. }catch(e) {
  30. console.log('error happened, skip.\n', e)
  31. }
  32. }
  33. if (document.readyState === 'loading') {
  34. document.addEventListener('DOMContentLoaded', setup)
  35. } else {
  36. setup()
  37. }
  38. })();