GoldenAgeComics for Webcomic Reader

Alternative to the currently unusable online viewer to be used with Webcomic Reader (http://userscripts.org/scripts/show/59842). Must be executed before Webcomic Reader to work

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           GoldenAgeComics for Webcomic Reader
// @author         ameboide
// @version        2011.05.25
// @namespace      http://userscripts.org/scripts/show/103786
// @description    Alternative to the currently unusable online viewer to be used with Webcomic Reader (http://userscripts.org/scripts/show/59842). Must be executed before Webcomic Reader to work
// @include        http://www.goldenagecomics.co.uk/*?dlid=*
// @include        http://goldenagecomics.co.uk/*?dlid=*
// @include        http://goldenagecomics.co.uk/comicreader/getComic.php?did=*
// ==/UserScript==

if(document.location.href.indexOf("dlid=") > 0){
	var linkOrig = document.querySelector('a[href^="comicreader"]');

	linkOrig.parentNode.innerHTML =
		'<a href="http://goldenagecomics.co.uk/comicreader/getComic.php?did=' +
		linkOrig.href.match(/did=(\d+)/)[1] +
		'">View with Webcomic Reader</a> ' +
		linkOrig.parentNode.innerHTML;
}
else{
	var imgs = document.body.innerHTML.match(/http:.+\.jpg/g);

	if(!imgs) html = "There's nothing here :(";
	else{
		var html = '<div id="cont"></div><div style="display:none">';
		for(var i=0; i<imgs.length; i++)
			html += '<a id="img_'+i+'" href="'+imgs[i]+'" >'+i+'</a> ';
		html += '</div>';
	}
	document.body.innerHTML = html;
}