SourceForge Instant Download

Bypass SourceForge download timer and disable post-download redirect

Verze ze dne 21. 07. 2024. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        SourceForge Instant Download
// @namespace   mevanlc
// @license     MIT
// @match       https://*.sourceforge.net/projects/*/files/*/download
// @match       https://*.sf.net/projects/*/files/*/download
// @grant       none
// @version     1.1
// @author      -
// @description Bypass SourceForge download timer and disable post-download redirect
// @run-at      document-start
// ==/UserScript==

const SFOverride = {
  downloadDelay: 1,
  downloadRedirectDelay: 9999999999,
};

SF = new Proxy(SF, {
  set: function (obj, prop, value) {
    if (SFOverride.hasOwnProperty(prop)) {
      console.log(`!!! userscript: ignoring attempt to set SF.${prop}=${value}`);
      return true;
    }
    obj[prop] = value;
    return true;
  },
  get: function (obj, prop) {
    if (SFOverride.hasOwnProperty(prop)) {
      console.log(`!!! userscript: returning override SF.${prop}=${SFOverride[prop]}`);
      return SFOverride[prop];
    }
    return obj[prop];
  },
});