! CurseTweaks

try to take over the world!

当前为 2020-09-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name ! CurseTweaks
  3. // @version 7_all
  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/*/*/*/download/*
  8. // @exclude https://www.curseforge.com/*/*/*/files/*
  9. // @match https://www.curseforge.com/*/*?*
  10. // @match https://www.curseforge.com/*/*/*/download
  11. // @run-at document-start
  12. // @grant unsafeWindow
  13. // @namespace https://greasyfork.org/users/45177
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. var filterID; var checkURL = window.location.pathname;
  20. var down = checkURL.split('/')[4]; var urlALL = window.location.href; var index = urlALL.split('?')[0];
  21. var game = urlALL.split('/')[3]; var type = urlALL.split('/')[4]; var mod = urlALL.split('/')[5];
  22.  
  23. if (down==='download'){
  24. function cookieREAD(cookieNAME) { var cname = ' ' + cookieNAME + '='; var cookies = document.cookie; if (cookies.indexOf(cname) == -1) { return filterID; } 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);}
  25. window.location.href = ("https://www.curseforge.com/" + game + "/" + type + "/" + mod + "/files/all?filter-game-version=" + cookieREAD('curseFilter'));
  26. };
  27.  
  28. setTimeout(function() {
  29. filterID = urlALL.split('=')[1];
  30. var data = new Date(9999,1,2);
  31. var finalDATA = data.toGMTString();
  32. document.cookie = 'curseFilter='+ filterID + '; expires=' + finalDATA + '; path=/';
  33. }, (1 * 3000));
  34.  
  35. })();