Gazelle Freeleech Browser

Inserts a freeleech link in main menu for Gazelle trackers. Torrents are grouped by default.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           Gazelle Freeleech Browser
// @author         mewx, the_dunce
// @namespace      http://tampermonkey.net/
// @description    Inserts a freeleech link in main menu for Gazelle trackers. Torrents are grouped by default.
// @include        http*://*orpheus.network/*
// @include        http*://*redacted.ch/*
// @include        http*://*dicmusic.club/*
// @include        http*://*greatposterwall.com/*
// @include        http*://*gazellegames.net/*
// @include        http*://*awesome-hd.me/*
// @include        http*://*alpharatio.cc/*
// @include        http*://*lztr.me/*
// @version        1.2
// @grant          none
// @license MIT
// ==/UserScript==

// Checking website.
var website = 'default';
var currentURL = '' + window.location;
if (currentURL.includes('greatposterwall')) {
    website = 'gpw';
}

function createFreeNode() {
	var a = document.createElement('a');
	a.innerHTML = 'Free';
	a.href = "torrents.php?freetorrent=1&group_results=1&action=advanced&searchsubmit=1";
    if (website == 'gpw') {
        a.className = 'HeaderNav-link';
    }

	var li = document.createElement('li');
    li.id = 'nav_free';
    if (website == 'gpw') {
        li.className = 'HeaderNavList-item';
    }
	li.appendChild(a);
	return li;
}

// Add new navigation button.
var target = null;
if (website == 'gpw') {
    target = document.getElementsByClassName('HeaderNav')[0].getElementsByTagName('ul')[0];
} else {
    target = document.getElementById('menu').getElementsByTagName('ul')[0];
}
target.appendChild(createFreeNode());