[Konachan / yande.re] Forum List: Default to Last Page

Replaces the "last" links in the forum list with "first" links and changes the main links to link to the last page.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo 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		[Konachan / yande.re] Forum List: Default to Last Page
// @namespace	Zolxys
// @description	Replaces the "last" links in the forum list with "first" links and changes the main links to link to the last page.
// @include		/^https?://konachan\.(com|net)/forum/?($|\?|#)/
// @include		/^https?://yande\.re/forum/?($|\?|#)/
// @version		1.1
// ==/UserScript==
var t = document.getElementById('forum').getElementsByTagName('table')[0].getElementsByTagName('td');
for (var i = 0; i < t.length; ++i) {
	var a = t[i].getElementsByTagName('a');
	if (a.length == 2)
	  if (a[1].innerHTML.trim() == 'last') {
		var h = a[0].href;
		a[0].href = a[1].href;
		a[1].href = h;
		a[1].innerHTML = 'first';
	}
}