Our Blog

An updated version is available at http://www.granjuxx.com.br/debugger

Internet Explorer’s InspectorXX debugger

Copy the content bellow to a file called C:InspectorXX.htm

<script language=”javascript”>

var pwin = external.menuArguments;
var pdoc = pwin.document;

//Aqui eu defino o conteúdo da tag <SCRIPT> que será adicionada à pagina;
var SCRIPTcode = “n”;

SCRIPTcode += ‘N = (document.all) ? 0 : 1;n’;
SCRIPTcode += ‘var ob;n’;
SCRIPTcode += ‘var over = false;n’;

SCRIPTcode += ‘function MD(e) {n’;
SCRIPTcode += ‘if (over)n’;
SCRIPTcode += ‘{n’;
SCRIPTcode += ‘if (N) {n’;
SCRIPTcode += ‘ob = document.getElementById(“inspectorXX”);n’;
SCRIPTcode += ‘X=e.layerX;n’;
SCRIPTcode += ‘Y=e.layerY;n’;
SCRIPTcode += ‘return false;n’;
SCRIPTcode += ‘}n’;
SCRIPTcode += ‘else {n’;
SCRIPTcode += ‘ob = document.getElementById(“inspectorXX”);n’;
SCRIPTcode += ‘ob = ob.style;n’;
SCRIPTcode += ‘X=event.offsetX;n’;
SCRIPTcode += ‘Y=event.offsetY;n’;

SCRIPTcode += ‘}n’;
SCRIPTcode += ‘}n’;
SCRIPTcode += ‘}n’;

SCRIPTcode += ‘function MM(e) {n’;
SCRIPTcode += ‘if (ob) {n’;
SCRIPTcode += ‘if (N) {n’;
SCRIPTcode += ‘ob.style.top = e.pageY-Y;n’;
SCRIPTcode += ‘ob.style.left = e.pageX-X;n’;

SCRIPTcode += ‘}n’;
SCRIPTcode += ‘else {n’;
SCRIPTcode += ‘ob.pixelLeft = event.clientX-X + document.body.scrollLeft;n’;
SCRIPTcode += ‘ob.pixelTop = event.clientY-Y + document.body.scrollTop;n’;
SCRIPTcode += ‘return false;n’;
SCRIPTcode += ‘      }n’;
SCRIPTcode += ‘   }n’;
SCRIPTcode += ‘}n’;

SCRIPTcode += ‘function MU() {n’;
SCRIPTcode += ‘ob = null;n’;
SCRIPTcode += ‘}n’;

SCRIPTcode += ‘if (N) {n’;
SCRIPTcode += ‘document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);n’;
SCRIPTcode += ‘}n’;

SCRIPTcode += ‘document.onmousedown = MD;n’;
SCRIPTcode += ‘document.onmousemove = MM;n’;
SCRIPTcode += ‘document.onmouseup = MU;n’;

//Aqui a tag <SCRIPT> é inserida
var scp = pdoc.createElement(“<SCRIPT LANGUAGE=’JavaScript’ id=ScriptXX>”);
pdoc.body.parentNode.childNodes(“HEAD”).appendChild(scp);
scp.text = SCRIPTcode;

//Aqui eu defino o conteúdo da tag <STYLE> que será adicionada à pagina;
var STYLEcode = “n”;

STYLEcode += ‘.titlerowXX {n’;
STYLEcode += ‘    font-weight: normal; n’;
STYLEcode += ‘    color: #ffffff; n’;
STYLEcode += ‘    font-family: Verdana, Helvetica, sans-serif, Geneva; n’;
STYLEcode += ‘    font-size: 9px;n’;
STYLEcode += ‘    border:1px #ffffff solid; n’;
STYLEcode += ‘    background : #006666;n’;
STYLEcode += ‘    padding:2px;n’;
STYLEcode += ‘}n’;

STYLEcode += ‘.tablerowXX {n’;
STYLEcode += ‘    background: #cccccc;n’;
STYLEcode += ‘    font-weight: normal; n’;
STYLEcode += ‘    color:#000000; n’;
STYLEcode += ‘    font-family: Verdana, Helvetica, sans-serif, Geneva; n’;
STYLEcode += ‘    font-size: 9px;n’;
STYLEcode += ‘    border:1px #ffffff solid;n’;
STYLEcode += ‘    padding:2pxn’;
STYLEcode += ‘}n’;

STYLEcode += ‘TABLE.tbfinaXX{n’;
STYLEcode += ‘    background:transparent;n’;
STYLEcode += ‘}n’;

STYLEcode += ‘.degradeeXX{ n’;
STYLEcode += ‘    filter: Alpha(Opacity=50, FinishOpacity=50, Style=2, StartX=100, StartY=100, FinishX=100, FinishY=100); n’;
STYLEcode += ‘    font-weight: normal; n’;
STYLEcode += ‘    color: #ffffff; n’;
STYLEcode += ‘    font-family: Verdana, Helvetica, sans-serif, Geneva; n’;
STYLEcode += ‘    font-size: 12px;n’;
STYLEcode += ‘    background : #006666;n’;
STYLEcode += ‘    border: 1px solid;n’;
STYLEcode += ‘    cursor:moven’;
STYLEcode += ‘}n’;

STYLEcode += ‘.inputXX {n’;
STYLEcode += ‘        color : #000000;n’;
STYLEcode += ‘        font: normal 11px Verdana, Arial, Helvetica, sans-serif;n’;
STYLEcode += ‘        border-color : #000000;n’;
STYLEcode += ‘        border-width:1px;n’;
STYLEcode += ‘}n’;
//Aqui a tag <STYLE> é inserida
var sty = pdoc.createElement(“<STYLE id=StyleXX>”);
pdoc.body.parentNode.childNodes(“HEAD”).appendChild(sty);
sty.styleSheet.cssText = STYLEcode;

//Aqui eu defino o conteúdo da tag <DIV> que será adicionada à pagina;
var HTMLcode = “”;
HTMLcode += “<DIV id=moveXX onmouseover=’over=true;’ onmouseout=’over=false;’ class=’degradeeXX’><b>&nbspInpectorXX Command Debugger® – version 2.0</b></div>”;
HTMLcode += ‘<form name=”CLform” style=”display: inline;”>’;
//HTMLcode += ‘    </p>’;
HTMLcode += ‘    <table border=0 class=”tbfinaXX”>’;
HTMLcode += ‘    <tr>’;
HTMLcode += ‘    <td valign=top class=”titlerowXX” style=”FONT: menu”><B>Code: </B></td>’;
HTMLcode += ‘    <td class=”tablerowXX”><textarea name=”code”  rows=”7″ cols=”70″ style=”background-color:#eeeeee”></textarea></td>’;
HTMLcode += ‘    <td class=”tablerowXX” valign=”middle” align=”center”>’;
HTMLcode +=       unescape(‘<input type=”button” name=”Go” class=”inputXX” onclick=”var f= CLform; try{ f.result.value =  eval(f.code.value)} catch(e) {f.result.value =  %27Error! n[%27+e.description+%27]%27};” value=”Go!”><br>’);

//HTMLcode +=          unescape(‘<input type=”button” name=”Element” class=”inputXX” onclick=”var f= CLform; try{var temp =  unescape(%27eval(%22var a =%27====> %22+f.code.value+%22 <====%27;nfor(p in %22+f.code.value+%22) a+=%27\n=> %27+p+%27: %27+eval(%27%22+f.code.value+%22.%27+p)%22+%22;na%22)%27); f.result.value = eval(temp)} catch(e) {f.result.value =  %27Error! n[%27+e.description+%27]%27};” value=”Element”>’);

HTMLcode += ‘    </td>’;
HTMLcode += ‘    </tr>’;
HTMLcode += ‘    <tr>’;
HTMLcode += ‘    <td class=”titlerowXX” valign=top  style=”FONT: menu”><B>Result: </B></td>’;
HTMLcode += ‘    <td class=”tablerowXX”><textarea name=”result” rows=”7″ cols=”70″ readonly style=”background-color:#eeeeee”></textarea></td>’;
HTMLcode += ‘    <td class=”tablerowXX” valign=”middle” align=”center”><input type=”button” name=”Reset” class=”inputXX” onclick=”var f= CLform; f.result.value = ‘+unescape(‘%27%27;’)+'” value=”Reset!”>’;
HTMLcode += ‘    </td>’;
HTMLcode += ‘    </tr>’;
HTMLcode += ‘    <tr><td class=”tablerowXX” colspan=3 style=”FONT: menu”>’;
HTMLcode += ‘<b>Code example</b>&nbsp;(Copy & paste it into the field <b>CODE</b>):’;
//HTMLcode += ‘xmlDesign.documentElement.childNodes(0).attributes(3).text<br>’;
//HTMLcode += ‘xmlDesign.documentElement.childNodes(0).getAttribute(“title”)<br><br>’;
HTMLcode += ‘<BLOCKQUOTE dir=ltr style=”MARGIN-RIGHT: 0px”>’;
HTMLcode += ‘<font color=”#006600″>//This code loop thru all properties of the <i>object</i> <b>window</b> and displays its contents:</font><br>’;
HTMLcode += ‘var temp = “”; var el = “window”;<br>’;
HTMLcode += ‘temp += “======== “+el+” ========n”;<br>’;
HTMLcode += ‘for(property in eval(el)){<br>’;
HTMLcode += ‘&nbsp;  temp += “=> “+ property + “: “+ eval(el+”.”+property)+”n”;<br>’;
HTMLcode += ‘};temp’;
HTMLcode += ‘</BLOCKQUOTE>’;
HTMLcode += ‘    </td></tr>’;
HTMLcode += ‘    <tr><td class=”tablerowXX” colspan=2 align=left><i>Copyright&copy;</i><b>&nbsp;Granjuxx</b> – www.granjuxx.com</td><td class=”tablerowXX” colspan=1 align=right><input type=”button” name=”Close” class=”inputXX” onclick=onclick=document.all[“ScriptXX”].removeNode(true);document.all[“StyleXX”].removeNode(true);document.all[“inspectorXX”].removeNode(true); value=”Close”></td></tr>’;
HTMLcode += ‘    </table></form>’;

//Aqui a tag <DIV> é inserida
var scr = pdoc.createElement(“<DIV id=inspectorXX style=’border-right: 2px solid black; border-bottom: 2px solid black; border-top: 2px solid black; border-left: 2px solid black;PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; Z-INDEX: 9999; LEFT: 30px; PADDING-BOTTOM: 0px; COLOR: #999999; PADDING-TOP: 0px; FONT-FAMILY: Tahoma; POSITION: absolute; TOP: 30px; BACKGROUND-COLOR: #cccccc; TEXT-ALIGN: left; ‘>”);
pdoc.body.appendChild(scr);
scr.innerHTML = HTMLcode;

</script>

*****

Create a file called C:InspectorXX.reg (open in Notepad), and add the following text.

REGEDIT4

[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMenuExt• InspectorXX]
@=”c:InspectorXX.htm”

*****

Run the reg file

*****

Restart i.e., and click with it with the right button. You will see a new entry called InspectorXX.

Bruno Grange

A passionate by software and a business enthusiast. Check out more about me at http://www.brunogrange.com