匙を投げる

(薬の調合のための匙を投げ出す意)医師が治療の方法がないと診断する。また、物事に救済や改善の見込みがないと断念する。「広辞苑第六版より」

Trixie+mgsで隠密mixiをちょっとだけ弄るの巻その2

id:sajiwo:20070223:p1で書いてたやつをほんのちょっとだけ弄ったよ。

弄ったとこ

  • 上のメニューバーみたいなのが、リストに変更されたみたいで見にくいので、そこだけなおした。
    • CSSのとこに、liを横に並べるような記述をしただけだよ。
  • 何故だかF5でも落ちなくなった。

画像を消したら[]がいっぱい表示されてキモいスクリプト

例のごとくsleipnirseahorseしか確認してません。でも自己責任で。

// mgs ver.0.4 by Hamachiya2. [ http://hamachiya.com/ ]
// mgs ver.0.4s2 by sawara. [ http://d.hatena.ne.jp/sajiwo/ ]
//
// ==UserScript==
// @name          MGS [v0.4s2]
// @namespace     http://hamachiya.com/
// @description	  mixiをこっそりみるやつ(はまちちゃんのスクリプトをちょっと弄ったよ)
// @include       http://mixi.jp/*
// @include       http://news.mixi.jp/*
// @exclude       http://mixi.jp/show_diary_picture.pl*
// ==/UserScript==

//
// Discussion forum: http://mixi.jp/view_diary.pl?id=51284108&owner_id=609805
//

(function() 
{
	var body = document.getElementsByTagName('body')[0];

	// title変更
	document.title = 'mixi';

	// 外部cssを無効化
	if (document.getElementsByTagName('LINK')[0]) {
		document.getElementsByTagName('LINK')[0].setAttribute('href', null);
	}

	// bodyタグの色がらみの要素を削除
	body.setAttribute('link', null, false);
	body.setAttribute('vlink', null, false);
	body.setAttribute('alink', null, false);
	body.setAttribute('text', null, false);

	with(body)innerHTML
	 = innerHTML
		//タグについてる属性を消す…のはやめて、ここは非エレガントにxxxにする
		.replace(/(<[^>]*)style([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)bgcolor([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)background([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)color([^>]*?>)/igm, '$1xxx$2')
//		.replace(/(<[^>]*)nowrap([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)v*align([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)align([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)class([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)width([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)height([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)cellspacing([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)cellpadding([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)border([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)[vh]space([^>]*?>)/igm, '$1xxx$2')
		// ↓なんか効かない。どこ間違ってるんだろ
		.replace(/(<[^>]*)onmouse([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)onclick([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)onfocus([^>]*?>)/igm, '$1xxx$2')
		.replace(/(<[^>]*)onblur([^>]*?>)/igm, '$1xxx$2')
		// ↓だからこうしたよ。日記タイトルにonmouseとか書かないで頂戴
		.replace(/onmouse/igm, 'xxx')

		// 検索ボックスけす
		.replace(/(<[^>]*)NAME="*MT"*([^>]*?>)/igm, '')

		//ALTつきの画像はALT内の文字にする
		.replace(/<img[^>]*alt=['"]*([^ ]*)['"]*[^>]*?>/igm, '[$1]')
		.replace(/<input[^>]*type=['"]*image['"]*[^>]*?loginbtn[^>]*?>/i, '<input type="submit" value="Login">')
		//.replace(/<input[^>]*type=['"]*image['"]*[^>]*?alt=['"]*([^ ]*)['"]*[^>]*?>/igm, '[$1]')

		//日記の画像を小さくする・普通の別窓リンクにする
		.replace(/<img[^>]+?(http:[^>]+?photo\/diary[^>]+?.jpg)[^>]*?>/igm, '<img\tsrc="$1" width="30" height="30">')
		.replace(/<a [^>]+?show_picture\.pl\?img_src=([^>]+?)\'[^>]+?>/igm, '<a href="$1" target="_blank">')

		//他の画像をけす
		.replace(/<img[^\t][^>]+?>/igm, '')
		.replace(/<input[^>]*type=['"]*image['"]*[^>]*?>/igm, '')
	;

	// ここからスタイルシート
	insetRule('*', 'padding:0; margin:0;font-size:100%');
	insetRule('body', 'background-color:#fefefe; color:#000');
	insetRule('a img', 'border: 1px solid #009');
	insetRule('a', 'color:#222; text-decoration: underline');
	insetRule('a:visited', 'color:#7c0060');
	insetRule('a:hover', 'background : #5eff5e;color:#000000');
	insetRule('a:active', 'color:#004a67');
	insetRule('li', 'width:12%;float:left;');
	insetRule('iframe', 'display:none');


// 以下style追加するやつ、こちらからいただいた!感謝!
// http://east.portland.ne.jp/~sigekazu/css/javascript3.htm
function insetRule(selector, declarations) {

	var sheets=document.styleSheets;

	if (sheets.length) {
		var tSheet=sheets[sheets.length-1];

		if (document.all) {
			tSheet.addRule(selector,declarations);
		} else {
			tSheet.insertRule(selector+"{"+declarations+"}",tSheet.cssRules.length);
		}
	}
}

})();