arXiv ar5iv Link

Add ar5iv link to arXiv page

  1. // ==UserScript==
  2. // @name arXiv ar5iv Link
  3. // @namespace https://github.com/sparanoid/userscript
  4. // @supportURL https://github.com/sparanoid/userscript/issues
  5. // @version 0.1.0
  6. // @description Add ar5iv link to arXiv page
  7. // @author Sparanoid
  8. // @license AGPL
  9. // @compatible chrome 80 or later
  10. // @compatible edge 80 or later
  11. // @compatible firefox 74 or later
  12. // @compatible safari 13.1 or later
  13. // @match https://arxiv.org/*
  14. // @icon https://external-content.duckduckgo.com/ip3/arxiv.org.ico
  15. // @grant none
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20. const arxivUrl = document.querySelector('meta[property="og:url"]')?.getAttribute('content');
  21. const list = document.querySelector('#abs-outer > .extra-services > .full-text > ul');
  22. const li = document.createElement('li');
  23. const link = document.createElement('a');
  24.  
  25. if (arxivUrl) {
  26. const ar5ivLink = arxivUrl.replace('arxiv', 'ar5iv');
  27. link.setAttribute('href', ar5ivLink);
  28. link.textContent = 'View in ar5iv';
  29.  
  30. li.appendChild(link);
  31. list.appendChild(li);
  32. }
  33. })();

QingJ © 2025

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