/ Published in: JavaScript
This is designed to be an IE Context Menu Script. Save this code to a .htm file, and link to it in the MenuExt registry key. More info at http://msdn.microsoft.com/en-us/library/aa753589(v=vs.85).aspx
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<SCRIPT LANGUAGE="JavaScript"> var parentwin = external.menuArguments; var doc = parentwin.document; String.prototype.endsWith = function(str) {return (this.match(str+"$")==str)} function formatString(mystring) { return mystring.substr(18,mystring.length-20); } var dubs = 'Dubs:\n'; for (var i=0; i < doc.links.length; i++) { var li = doc.links[i]; if (li.innerText.endsWith('XXX') && li.href.charAt(li.href.length-3) == li.href.charAt(li.href.length-4)) { dubs +='>>'+ formatString(li.href)+'\n'; } } var trips= 'Trips:\n'; for (var i=0; i < doc.links.length; i++) { var li = doc.links[i]; if (li.innerText.endsWith('XXX') && li.href.charAt(li.href.length-3) == li.href.charAt(li.href.length-4) && li.href.charAt(li.href.length-4) == li.href.charAt(li.href.length-5)) { trips += '>>'+formatString(li.href)+'\n'; } } alert(dubs+trips); </script>