Created
February 5, 2009 15:41
-
-
Save satyr/58757 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name livedoor 4koma expander | |
// @namespace http://d.hatena.ne.jp/murky-satyr | |
// @description Expands each comic on http://4koma.livedoor.com | |
// @include http://4koma.livedoor.com/y1/member/* | |
// @include http://4koma.livedoor.com/creator/profile/* | |
// ==/UserScript== | |
const R = (/y1/.test(location) | |
? function(s, i) s.replace(/0(?=\.jpg)/, i) | |
: function(s, i) s.replace(/0s(?=\.jpg)/, i)); | |
function ld4kx([table]){ | |
table && Array.forEach(table.getElementsByTagName('td'), function(td){ | |
var {src} = td.getElementsByTagName('img')[0] || 0; | |
if(src) for(var i = 0, s; ++i <= 4 && (s = R(src, i)) !== src;) | |
td.appendChild(new Image).src = s; | |
}); | |
} | |
ld4kx([document.querySelector('.backnumber')]); | |
setTimeout(function(){ self.AutoPagerize && AutoPagerize.addFilter(ld4kx) }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment