arXiv paper homepage tranverse

在arixv的pdf和abstract反复横跳 Generate a button to trans between arixv homepage and pdf

  1. // ==UserScript==
  2. // @name arXiv paper homepage tranverse
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 在arixv的pdf和abstract反复横跳 Generate a button to trans between arixv homepage and pdf
  6. // @author holo
  7. // @match https://arxiv.org/pdf/*
  8. // @match https://arxiv.org/abs/*
  9. // @grant none
  10. // ==/UserScript==
  11. (function(){
  12. // download by clicking on the button
  13. var btn = document.createElement("button");
  14. btn.setAttribute('style', "position:absolute;z-index:1000; right: 50px; top: 50px; height: 28px; background-color: #424649; border: none; color: white; font-size: 16px; cursor: pointer;");
  15. btn.setAttribute('id', "btn");
  16. document.body.appendChild(btn);
  17. btn.onmouseover = function() {
  18. this.style.backgroundColor="#424649"
  19. };
  20. btn.onmouseout = function() {
  21. this.style.backgroundColor="#323639"
  22. };
  23. var url = window.location.href
  24. if(url.slice(-3) == "pdf"){
  25. btn.innerText = "arivx";
  26. btn.onclick=arixv;
  27.  
  28. }else{
  29. btn.innerText = "pdf";
  30. btn.onclick=pdf;
  31. }
  32. // btn.innerText = url.slice(-3)
  33. }
  34. )()
  35.  
  36.  
  37. function arixv(){
  38. var home_url = window.location.href.slice(0, -4).replace('pdf', 'abs');
  39. window.open(home_url);
  40. }
  41.  
  42. function pdf(){
  43. var home_url = window.location.href.replace('abs', 'pdf') + ".pdf";
  44. window.open(home_url);
  45. }

QingJ © 2025

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