2006年 12月 16日

エロサイトで便利かもしれない GMS

	var host = (frames.top) ? frames.top.location.host : location.host;
	Array.forEach(document.getElementsByTagName('a'), function (e) {
		log(host, e.href);
		if (e.href.indexOf(host) != -1 && e.href.indexOf('http:', 1) == -1) {
			e.style.background = '#f00';
			e.style.fontWeight = 'bold';
		}
	});

というのをざっと書いたのだけど、セキュリティエラーで frame がうまく処理できない。
(同じホストへのリンクをハイライトするものです。普通のサイトに使うとうざったい。あと out.php?h=http://hoge/ みたいなのを排除)