Greasy Fork is available in English.

Manga Loader (unmaintained)

Support for over 70 sites! Loads manga chapter into one page in a long strip format, supports switching chapters, minimal script with no dependencies, easy to implement new sites, loads quickly and works on mobile devices through bookmarklet

< 腳本Manga Loader (unmaintained)的回應

提問/評論

§
發表於:2015-10-24
編輯:2015-10-24

Mangafox changed

Mangafox changed it's CDNs and they have onerror patch on each image. I tried to make a fix for your script, and in the end it was too hard. So I made a fix for another script but I don't like their interface and excessive jQuery usage.

They generally have two tries on any image img and altimg

function getStr(str, from, to) {
    return str.substring(str.indexOf(from) + from.length, str.indexOf(to) + to.length);
}
var image = $(html).find('img'),
    src = image[0].src,
    altImg = image[0].onerror.toString(),
    altSrc = getStr(altImg, '.src=\'', '.jpg');
addAltImg(i, src);
addImg(i, altSrc);

Could you add this fix to mangafox part? Thank you!

fuzetsu作者
§
發表於:2015-10-26

SHould be fixed in v1.9.6. You were pretty much on the right track there just that my script works receives the URLs a little bit different.

  img: function(ctx) {
  	var img = getEl('#image', ctx);
  	return img.getAttribute('onerror').match(/'([^']+)'/)[1];
  }

In this case all I had to change was the img selector a function that got the url out of the onerror attribute.

§
發表於:2015-10-26

They might fix their CDN, that's why I suggested to use two images one as primary and one as secondary if primary fails....

§
發表於:2015-10-26

And thanks for the code )

fuzetsu作者
§
發表於:2015-10-26

I don't have any handling for alternate src's yet, since it doesn't apply to most sites. Even if they fix their cdn as long as the onerror src works then it should be fine. I'll have to keep an eye on it though.

發表回覆

登入以回復