! CurseTweaks [MC]

try to take over the world!

当前为 2020-08-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name ! CurseTweaks [MC]
  3. // @version 4
  4. // @description try to take over the world!
  5. // @icon https://www.google.com/s2/favicons?domain=curseforge.com
  6. // @author Diegiwg
  7. // @exclude https://www.curseforge.com/minecraft/*/*/download/*
  8. // @exclude https://www.curseforge.com/minecraft/*/*/files/*
  9. // @match https://www.curseforge.com/minecraft/*
  10. // @run-at document-start
  11. // @grant unsafeWindow
  12. // @namespace https://greasyfork.org/users/45177
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const curse = "https://www.curseforge.com/minecraft/mc-mods/"; var mcID; var checkURL = window.location.pathname;
  19. var down = checkURL.split('/')[4]; var urlALL = window.location.href; var index = urlALL.split('?')[0];
  20.  
  21. if (down==='download'){
  22. function cookieREAD(cookieNAME) { var cname = ' ' + cookieNAME + '='; var cookies = document.cookie; if (cookies.indexOf(cname) == -1) { return mcID; } cookies = cookies.substr(cookies.indexOf(cname), cookies.length); if (cookies.indexOf(';') != -1) { cookies = cookies.substr(0, cookies.indexOf(';')); } cookies = cookies.split('=')[1]; return decodeURI(cookies);}
  23. location.replace(curse + checkURL.split('/')[3] + '/files/all?filter-game-version=' + cookieREAD('curseMC'));
  24. };
  25.  
  26. setTimeout(function() {
  27. mcID = urlALL.split('=')[1];
  28. var data = new Date(9999,1,2);
  29. var finalDATA = data.toGMTString();
  30. document.cookie = 'curseMC='+ mcID + '; expires=' + finalDATA + '; path=/';
  31. }, (1 * 1000));
  32.  
  33. })();