CurseTweaks

Automatically applies the filters set in the Mods search to the mod's 'Download' button. The goal is to make downloads easier, taking the user to all the files compatible with the version of the Game he wants to play.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         CurseTweaks
// @version      9.0
// @description  Automatically applies the filters set in the Mods search to the mod's 'Download' button. The goal is to make downloads easier, taking the user to all the files compatible with the version of the Game he wants to play.
// @icon         https://www.google.com/s2/favicons?domain=curseforge.com
// @author       Diegiwg
// @exclude      https://www.curseforge.com/*/*/*/download/*
// @exclude      https://www.curseforge.com/*/*/*/files/*
// @match        https://www.curseforge.com/*/*?*
// @match        https://www.curseforge.com/*/*/*/download
// @run-at       document-start
// @grant        unsafeWindow
// @namespace    https://greasyfork.org/users/45177
// ==/UserScript==

(function() {
    'use strict';

var filterID; var checkURL = window.location.pathname;
var down = checkURL.split('/')[4]; var urlALL = window.location.href; var index = urlALL.split('?')[0];
var game = urlALL.split('/')[3]; var type = urlALL.split('/')[4]; var mod = urlALL.split('/')[5];
	
if (down==='download'){
    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);}
    window.location.href = ("https://www.curseforge.com/" + game + "/" + type + "/" + mod + "/files/all?filter-game-version=" + cookieREAD('curseFilter'));
};

setTimeout(function() {
    filterID = urlALL.split('=')[1];
    var data = new Date(9999,1,2);
    var finalDATA = data.toGMTString();
    document.cookie = 'curseFilter='+ filterID + '; expires=' + finalDATA + '; path=/';
}, (1 * 3000));

})();