pagehack.js


  ブックマークレットよりロードされる .js ファイル




本体画面をペースに window.open されたウインドウに対して、スクリプトエレメントを document.write する事によって、開かれたウインドウに .js ファイルをロードしています。

内部から画面部分は document.write で作成します。

//document.charset = 'shift_jis';

document.getElementById("area").style.fontFamily = 'MS ゴシック';
document.getElementById("area").style.fontSize = '12px';
//document.getElementById("area").value = opener.document.body.innerHTML;

style = document.styleSheets;
if (window.navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
	document.styleSheets[0].addRule("H1", "font-family:'MS Pゴシック';font-size: 12px;border-style: solid;border-width: 1px;border-color: #9192A3;padding: 7px 0px 8px 13px;background: url( http://winofsql.jp/image/h1.png ) repeat-x 0px 0px;");
	document.styleSheets[0].addRule("BODY", "background-color:#C5D1A5;");
}
else {
	document.styleSheets[0].insertRule("H1 {font-family:'MS Pゴシック';font-size: 12px;border-style: solid;border-width: 1px;border-color: #9192A3;padding: 7px 0px 8px 13px;background: url( http://winofsql.jp/image/h1.png ) repeat-x 0px 0px;}",0);
	document.styleSheets[0].insertRule("BODY {background-color:#C5D1A5;}",0);
}



html="<H1>Page Hacker (&#87;&#69;&#66;&#12506;&#12540;&#12472;&#35519;&#26619;&#25903;&#25588;)</H1>";
html+="<table><tr>";
html+="<td><input type=button value='body' style='vertical-align:middle;width:70px;' onClick='dispBody();'> / ";
html+="<input type=button value='head' style='vertical-align:middle;width:50px;' onClick='dispHead();'>";
html+="<input type=button value='css' style='vertical-align:middle;width:50px;' onClick='dispCss();'> / ";
html+="<input type=button value='A' style='vertical-align:middle;width:20px;' onClick='dispA();'> / ";
html+="<input type=button value='A+text' style='vertical-align:middle;width:50px;' onClick='dispA2();'> / ";
html+="<input type=button value='&#12362;&#27671;&#12395;&#20837;&#12426;&#12395;&#30331;&#37682;&#12377;&#12427;&#12467;&#12540;&#12489;' style='vertical-align:middle;width:180px;' onClick='dispFav();'>";
if (window.navigator.userAgent.toLowerCase().indexOf("firefox") <= -1) {
	html+="<input type=button value='&#70;&#105;&#114;&#101;&#98;&#117;&#103;&#32;&#76;&#105;&#116;&#101;&#12434;&#38283;&#12367;' style='vertical-align:middle;width:130px;' onClick='dispFirebug();'>";
}
html+="</td></tr><tr><td>";
html+="<input type=button value='&#8595;&#12463;&#12522;&#12483;&#12503;&#12508;&#12540;&#12489;&#12408;&#12467;&#12500;&#12540;' style='vertical-align:middle;width:150px;' onClick='CopyClip();'> / ";
html+="<input type=button value='&#12479;&#12452;&#12488;&#12523;&#12467;&#12500;&#12540;' style='vertical-align:middle;width:150px;' onClick='copyTitle();'> / ";
html+="</td></tr></table>";
if (window.navigator.userAgent.toLowerCase().indexOf("msie") <= -1) {
	html+="<OBJECT \n";
	html+="	id=\"flash1\" \n";
	html+="	classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \n";
	html+="	width=0 \n";
	html+="	height=0 \n";
	html+="> \n";
	html+="	<PARAM name=\"movie\" value=\"http://homepage2.nifty.com/lightbox/setClipboard.swf\"> \n";
	html+="	<PARAM name=\"allowScriptAccess\" value=\"always\"> \n";
	html+=" \n";
	html+="	<EMBED \n";
	html+="		id=\"flash2\" \n";
	html+="		name=\"utilWeblog\" \n";
	html+="		swliveconnect=\"true\" \n";
	html+="		src=\"http://homepage2.nifty.com/lightbox/setClipboard.swf\" \n";
	html+="		allowScriptAccess=\"always\" \n";
	html+="		width=0 \n";
	html+="		height=0 \n";
	html+="		type=\"application/x-shockwave-flash\" \n";
	html+="	> \n";
	html+="</OBJECT> \n";
	html+=" ";
}

document.getElementById("cont").innerHTML = html;

function dispHead() {
	document.getElementById("area").value = opener.document.getElementsByTagName("HEAD")[0].innerHTML;
}
function dispBody() {
	document.getElementById("area").value = opener.document.body.innerHTML;
}
function dispFav() {
	document.getElementById("area").value = "javascript: var wnd=window.open('','_blank','width=700,height=600,location=0,resizable=1,menubar=0,scrollbars=0,status=1');wnd.document.write('<style>body{ margin:0; }</style><div id=cont style=\"height:100px;\"></div><textarea readonly id=area style=\"width:100%;height:300px;\"></textarea><script src=\"http://winofsql.jp/pagehack.js\"></script>');wnd.document.close();";
}
function dispFirebug() {
	console.open();
}
function copyTitle() {
   var str = "%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%82%92%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E3%83%9C%E3%83%BC%E3%83%89%E3%81%B8%E3%82%B3%E3%83%94%E3%83%BC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F";
   if (window.navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
	window.clipboardData.setData(
		 "Text", opener.document.title
	);
	alert( decodeURIComponent(str) );
   }
   else {
	try {
		setClipboard( opener.document.getElementsByTagName("TITLE")[0].text );
		alert( decodeURIComponent(str) );
	}
	catch(e) {
	}
   }
}

function dispA() {
	__target = null;
	str = "";
	__target = opener.document.getElementsByTagName("A");
	len = __target.length;
	for (j = 0; j < len; j++) {
	    str += __target[j] + "\n";
	}
	document.getElementById("area").value = str;
}
function dispA2() {
	__target = null;
	str = "";
	__target = opener.document.getElementsByTagName("A");
	len = __target.length;
	for (j = 0; j < len; j++) {
	    str += __target[j].innerHTML + "\t\n";
	    str += __target[j] + "\n";
	}
	document.getElementById("area").value = str;
}

function dispCss() {
	style = null;
	rule = null;
	len = 0;
	str = "";
	work = null;
	style = opener.document.styleSheets;
	for (j = 0; j < style.length; j++) {
		if (window.navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
		    rule = style[j].rules;
		}
		else {
			rule = style[j].cssRules
		}
	    len = rule.length;
	    for (i = 0; i < len; i++) {
	        str += rule[i].selectorText + "\n--------------------\n";
			try {
		        work = (rule[i].style.cssText).split(";");
		        for (k = 0; k < work.length; k++) {
		            str += (work[k] + ";\n");
		        }
		        str += "--------------------\n";
			}
			catch(e) {
			}
	    }
	}
	document.getElementById("area").value = str;
//	window.clipboardData.setData("Text", str);
//	alert("↓cssの一覧をコピーしました   %5Cn%5Cn" + str);
}
function CopyClip( ) {

	if (window.navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
		window.clipboardData.setData(
			 "Text", document.getElementById("area").value
		);
	}
	else {
		setClipboard( document.getElementById("area").value );
	}

	alert( decodeURIComponent("%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E3%83%9C%E3%83%BC%E3%83%89%E3%81%B8%E3%82%B3%E3%83%94%E3%83%BC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F") );

}
function setClipboard( strValue ) {

	var obj;

	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		obj = document.getElementById("flash1");
	}
	else {
		obj = document.getElementById("flash2");
	}

	obj.setClipboard(strValue);

}


obj = document.createElement("script");
obj.setAttribute("type", "text/javascript");
obj.src = "http://homepage2.nifty.com/lightbox/firebug_hack/firebug.js"
document.getElementsByTagName("HEAD")[0].appendChild(obj);

if (window.navigator.userAgent.toLowerCase().indexOf("firefox") > -1) {
	alert(decodeURIComponent("firefox%E3%81%A7%E8%B5%B7%E5%8B%95%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%81%AE%E3%81%A7firebug%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E8%A6%AA%E3%82%A6%E3%82%A4%E3%83%B3%E3%83%89%E3%82%A6%E3%82%92%E5%8F%82%E7%85%A7%E3%81%97%E3%81%A6%E4%B8%8B%E3%81%95%E3%81%84\n%E3%81%9D%E3%81%AE%E5%A0%B4%E5%90%88%E3%80%81opener%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%A8%E5%8F%82%E7%85%A7%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99"))
}











yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  辞書  天気 


[sh_tool]
claudebot
24/03/29 21:19:12
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube