自动将arXiv的HTML页面重定向原版页面

自动将arXiv的HTML页面重定向原版页面arXiv HTML to Abs Redirect

  1. // ==UserScript==
  2. // @name 自动将arXiv的HTML页面重定向原版页面
  3. // @namespace dev
  4. // @version 1.1
  5. // @description 自动将arXiv的HTML页面重定向原版页面arXiv HTML to Abs Redirect
  6. // @author dev
  7. // @match https://arxiv.org/html/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // 获取当前路径中的论文ID(包含可能的版本号)
  16. const pathSegments = window.location.pathname.split('/');
  17. const paperId = pathSegments[2]; // 路径格式为 /html/xxxxx
  18.  
  19. // 只有当路径有效时才执行跳转
  20. if (paperId) {
  21. // 保留所有查询参数
  22. const queryString = window.location.search;
  23. // 构建新的abs链接
  24. const absUrl = `https://arxiv.org/abs/${paperId}${queryString}`;
  25. // 立即跳转(替换当前历史记录)
  26. window.location.replace(absUrl);
  27. }
  28. })();

QingJ © 2025

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