// ==UserScript== // @name Nexus Mods - Stardew Valley - Download Mod Faster - Improved UX // @namespace https://bitbucket.org/antonolsson91/nexus-mods-stardew-valley-improved-ux/ // @version 1.0.2 // @tags nexusmods.com, nexusmods, stardew valley, stardewvalley, stardew valley mods, sdv mods, stv mods, improved ux // @description Improves the user experience for nexusmods.com visitors by adding Insta-DL buttons in various places like |1) categories mod tiles |2) mod description/file page // @author Anton Olsson // @authoremail eagleenterprises08+nexusmods@gmail.com // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html // @editURL https://gitpod.io/#https://bitbucket.org/antonolsson91/nexus-mods-stardew-valley-improved-ux/src/master/ // @include https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js // @match https://www.nexusmods.com/stardewvalley/* // @grant none // @downloadURL https://update.greasyfork.icu/scripts/421906/Nexus%20Mods%20-%20Stardew%20Valley%20-%20Download%20Mod%20Faster%20-%20Improved%20UX.user.js // @updateURL https://update.greasyfork.icu/scripts/421906/Nexus%20Mods%20-%20Stardew%20Valley%20-%20Download%20Mod%20Faster%20-%20Improved%20UX.meta.js // ==/UserScript== (($) => { let DMF = { STVGameId: 1303, startDownload: function (file_id, game_id, btn) { console.log(`Called startDownload(${file_id},${game_id}, ${btn})`) $.ajax( { type: "POST", url: "/Core/Libs/Common/Managers/Downloads?GenerateDownloadUrl", data: { fid: file_id, game_id: game_id, }, success: function (data, error) { if (data && data.url) { console.log('Success'); //window.location.href = data.url; window.open(data.url) btn.attr("disabled", "true").append(`✅`) $('.donation-wrapper > p').html('
Your download has started
If you are having trouble, click here to download manually
'); } else { console.trace("Error posting:", error); } }, error: function (e) { console.trace(e); } } ); }, loader: function(){ return $(`