Adding features to Internet Explorer

Snufkin is a much more advanced form of this, and there are other techniques.

Internet Explorer has an extremely flexible object model, and combining this with the ability to automate it from script, you can easily add features to the browser to overcome some flaws.

To do this you need to install ScriptX an ActiveX control from Meadroid available from Meadroid it actually is for printing from IE, but it gives the ability to scripts to connect to events from applications.

After installing ScriptX (no need to accept any "licences") download launch.wsf and run it, this will open a copy of Internet Explorer and navigate to http://ppewww.ph.gla.ac.uk/~flavell/alt/ (a useful test page). You will then see a menu across the top, this is created from LINK elements in the HTML, and a link to validate the page, and a link to provide a menu of links down the left of the page.

Code is poorly tested, any comments, updates, suggestions would be very much welcome.

Contents of launch.wsf

<job id="Iexp"> <script language=jscript> IE = new ActiveXObject("InternetExplorer.Application") IE.Visible = true Factory = new ActiveXObject("ScriptX.Factory") Sink = Factory.NewEventSink(IE) Sink("DocumentComplete")=DocumentComplete Sink("OnQuit")=onQuit IE.Navigate2("http://ppewww.ph.gla.ac.uk/~flavell/alt/") Sink.Wait(); Factory.Shutdown(); function onQuit() { this.Unadvise(); } function DocumentComplete(win,b) { LE=win.document.getElementsByTagName('LINK'); Str='<div style="position:absolute;top:0;left:0;width:expression(document.body.clientWidth);height:30px;background-color:activeborder;margin:0px;padding:2px;border:2px inset activeborder;">'; for (i=0;i<LE.length;i++) { txt=LE[i].rel != ''? LE[i].rel : LE[i].rev; if (txt=="SHORTCUT ICON") txt='icon' if (txt.toLowerCase()!="stylesheet") Str+='<A href="'+LE[i].href+'" style="color:menutext;background-color:activeborder;">'+txt+'</A> | '; } Str+='<a href="javascript:void(window.open(\'http://valet.webthing.com/page/val.cgi?url=\'+escape(location.href)+\'&demoronise=on&spell=on\',\'validator\'))" style="color:menutext;background-color:activeborder;">Validate</A> | ' Str+='<a href="javascript:void __JL_Links()" style="color:menutext;background-color:activeborder;">Links</a>' Str+='</DIV>' Str+='<script defer>function __JL_Links() {\n dd=document.body.innerHTML\n var links=document.links;var str=\'\';\n for (var i='+i+';i<links.length;i++) {\n if ( links(i).innerText != "" && links(i).innerText != " ") {\n str+="<A HREF=\'" + links(i).href + "\' style=\'color:menutext;background-color:activeborder;\' TITLE=\'" + links(i).href + "\'>" + links(i).innerText + "</a><BR>"\n } else {\n alt=links(i).childNodes(0).alt\n if (alt=="") alt=links(i).href\n str+="<A HREF=\'" + links(i).href + "\' TITLE=\'" + links(i).href + "\' style=\'color:menutext;background-color:activeborder;\'>" + alt + "</a><BR>";\n }\n } \n document.body.innerHTML=\'<div style="position:absolute;top:30;left:0;height:expression(document.body.clientHeight-30);width:120px;background-color:activeborder;margin:0px;padding:2px;border:2px inset activeborder;">\'+str+\'</div>\'+dd\n document.body.style.marginLeft+=150\n }\n</scr'+'ipt>' win.document.body.style.marginTop=30 win.document.body.innerHTML=Str+win.document.body.innerHTML } </script> </job>