Skip to content

Instantly share code, notes, and snippets.

@satyr
Created February 5, 2009 15:41
Show Gist options
  • Save satyr/58757 to your computer and use it in GitHub Desktop.
Save satyr/58757 to your computer and use it in GitHub Desktop.
// ==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