Old Curseforge Please!

Converts curseforge.com links to legacy.curseforge.com links

  1. // ==UserScript==
  2. // @name Old Curseforge Please!
  3. // @version 1.0
  4. // @description Converts curseforge.com links to legacy.curseforge.com links
  5. // @namespace hrudyplayz.com
  6. // @license MIT
  7. // @author HRudyPlayZ
  8. // @match *://www.curseforge.com/*
  9. // @icon https://www.google.com/s2/favicons?domain=www.curseforge.com
  10. // @grant none
  11. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. // Adapted from Ksir's Old Reddit Please! https://gf.qytechs.cn/fr/scripts/40897-old-reddit-please
  15.  
  16. function test(url) {
  17. return url.match(/^(|http(s?):\/\/)(|www\.)curseforge\.com(\/.*|$)/gim);
  18. }
  19.  
  20. function getNewPagePlease(url) {
  21. return 'https://legacy.curseforge.com' + url.split('curseforge.com').pop();
  22. }
  23.  
  24. function fixCurseforgeStuff() {
  25. var links = Array.prototype.slice.call(document.links, 0);
  26.  
  27. links.filter(function(link) {
  28. if(test(link.href)) {
  29. var newLink = getNewPagePlease(link.href);
  30. link.setAttribute('href', newLink);
  31. }
  32. });
  33. }
  34.  
  35. if (test(window.location.href)) window.location.assign(getNewPagePlease(window.location.href));
  36.  
  37. window.onload = fixCurseforgeStuff;
  38. setInterval(fixCurseforgeStuff, 50);

QingJ © 2025

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