directGelF

direct link to all gelbooru images in search results+

Versione datata 09/09/2014. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name          directGelF
// @namespace     directGelF
// @version       1.6
// @description   direct link to all gelbooru images in search results+
// @homepage      https://userscripts.org/scripts/show/137366
// @run-at        document-end
// @grant         GM_openInTab
// @include       http://gelbooru.com/*
// @match         http://gelbooru.com/*
// ==/UserScript==

if (typeof GM_openInTab === "undefined")
{
	GM_openInTab = window.open;
}

var els = document.getElementsByClassName("preview");

for(var x = 0; x < els.length; x++) 
{
	// Obtaining the final URL of the image
	var dir = els[x].src;
	dir = dir.split("thumbnails")[1] || dir.split("thumbs")[1]; // gelbooru sometimes can't decide one
	dir = dir.split('?')[0].replace("thumbnail_","");
	dir = "http://youhate.us//images" + dir;
	
	// Setting original link to right click
	els[x].setAttribute('id',els[x].parentNode.href); // save url
    els[x].setAttribute('oncontextmenu',"return false;"); // block menu
	els[x].addEventListener('contextmenu', function(aEvent) {GM_openInTab(this.id);window.focus();}, true, true); // R-Click

	// Setting the new href
	els[x].parentNode.href = dir;
}