Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Highlighting Text in a Web Page
#1
Hi Gintaras,
I found this link in the forum:
Find and highlight text in other app using regular expresion

and the great function for highlighting text in a Rich Edit field. I am interested in highlighting text that is on a web page however. The text doesn't cross html elements - just searching for names from a short list to make them easy for the user to find on a complicated website.

I looked for bookmarklets to do this but many are only for Mozilla and the webpage is being hung in a OpenInTbWebBrowser type toolbar so don't know if I could even use an IE bookmarklet.

Hope this isn't more complicated than I realize!

Stuart
#2
If you know an IE bookmarklet, try
web "javascript:..." 0 hDlg

Don't know how to do it using html elements, but probably possible.
#3
Thanks. I will keep on looking for a bookmarklet on line and now I know how to put them onto a webtoolbar.
Thanks again. Stuart
#4
I found these two scripts which are relevant (as well as some other cool bookmarklets) here:

https://www.squarefree.com/bookmarklets/pagedata.html

There is one that highlights each occurrence of a search phrase (presented through a simple dialog):

The javascript is here:
Code:
Copy      Help
javascript:(function(){var count=0, text, dv;text=prompt("Search phrase:", "");if(text==null || text.length==0)return;dv=document.defaultView;function searchWithinNode(node, te, len){var pos, skip, spannode, middlebit, endbit, middleclone;skip=0;if( node.nodeType==3 ){pos=node.data.toUpperCase().indexOf(te);if(pos>=0){spannode=document.createElement("SPAN");spannode.style.backgroundColor="yellow";middlebit=node.splitText(pos);endbit=middlebit.splitText(len);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);++count;skip=1;}}else if( node.nodeType==1&& node.childNodes && node.tagName.toUpperCase()!="SCRIPT" && node.tagName.toUpperCase!="STYLE"){for (var child=0; child < node.childNodes.length; ++child){child=child+searchWithinNode(node.childNodes[child], te, len);}}return skip;}window.status="Searching for '"+text+"'...";searchWithinNode(document.body, text.toUpperCase(), text.length);window.status="Found "+count+" occurrence"+(count==1?"":"s")+" of '"+text+"'.";})();

The other one does the same thing but for regular expressions:

Code:
Copy      Help
javascript:(function(){var count=0, text, regexp;text=prompt("Search regexp:", "");if(text==null || text.length==0)return;try{regexp=new RegExp("(" + text +")", "i");}catch(er){alert("Unable to create regular expression using text '"+text+"'.\n\n"+er);return;}function searchWithinNode(node, re){var pos, skip, spannode, middlebit, endbit, middleclone;skip=0;if( node.nodeType==3 ){pos=node.data.search(re);if(pos>=0){spannode=document.createElement("SPAN");spannode.style.backgroundColor="yellow";middlebit=node.splitText(pos);endbit=middlebit.splitText(RegExp.$1.length);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);++count;skip=1;}}else if( node.nodeType==1 && node.childNodes && node.tagName.toUpperCase()!="SCRIPT" && node.tagName.toUpperCase!="STYLE"){for (var child=0; child < node.childNodes.length; ++child){child=child+searchWithinNode(node.childNodes[child], re);}}return skip;}window.status="Searching for "+regexp+"...";searchWithinNode(document.body, regexp);window.status="Found "+count+" match"+(count==1?"":"es")+" for "+regexp+".";})();


The website says they work only for Mozilla/Firefox or Opera browsers but I thought maybe they can be reverse engineered to work in QM (Toolbar Webbrowser). I haven't had a chance to look at them carefully (I don't know javascript ) but I post them here in case someone wants to take a crack at them.

Good luck...I will post any progress I make as well.

Stuart
#5
Getting closer....
I found a bookmarklet that highlights text in IE on this website:

http://subsimple.com/bookmarklets/import_ie.htm
Code:
Copy      Help
javascript:function H(w,s){r=w.document.body.createTextRange();for(i=0;r.findText(s);i++){r.execCommand('BackColor','','yellow');r.collapse(false);}return i;}function G(){if(frames.length==0)return document.selection.createRange().text;else for(k=0;F=frames[k];++k){u=F.document.selection.createRange().text;if(u)return u;}}function P(){var t=0,s=G();if(!s)s=prompt('Find:','');if(s){if(frames.length==0)t+=H(window,s);else for(j=0;F=frames[j];++j)t+=H(F,s);alert(t+' found.');}}P();

I tried to incorporate it into Toolbar with Web Browser using the example from the Resources Archive

Macro
Code:
Copy      Help
str jshilite = "javascript:function H(w,s){r=w.document.body.createTextRange();for(i=0;r.findText(s);i++){r.execCommand('BackColor','','yellow');r.collapse(false);}return i;}function G(){if(frames.length==0)return document.selection.createRange().text;else for(k=0;F=frames[k];++k){u=F.document.selection.createRange().text;if(u)return u;}}function P(){var t=0,s=G();if(!s)s=prompt('Find:','');if(s){if(frames.length==0)t+=H(window,s);else for(j=0;F=frames[j];++j)t+=H(F,s);alert(t+' found.');}}P();"

int hwnd =  win("TOOLBAR WITH WEB BROWSER" "QM_toolbar")


;int hDlg
web jshilite 0 hwnd

I hear the clicking of a web page loading but don't see any search dialog. Any have any idea what I may be doing wrong?

Thanks,
Stuart
#6
Function dlg_web_hilite
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str ax3SHD
ax3SHD=
;<A href="javascript:function H(w,s){r=w.document.body.createTextRange();for(i=0;r.findText(s);i++){r.execCommand('BackColor','','yellow');r.collapse(false);}return i;}function G(){if(frames.length==0)return document.selection.createRange().text;else for(k=0;F=frames[k];++k){u=F.document.selection.createRange().text;if(u)return u;}}function P(){var t=0,s=G();if(!s)s=prompt('Find:','');if(s){if(frames.length==0)t+=H(window,s);else for(j=0;F=frames[j];++j)t+=H(F,s);alert(t+' found.');}}P();" ADD_DATE="1044141169" LAST_MODIFIED="0" LAST_VISIT="0">Hilite Text</A>
;<p>one two three</p>
;<p>one two three</p>
if(!ShowDialog("dlg_web_hilite" &dlg_web_hilite &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 465 346 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 468 346 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2030006 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#7
Awesome!!!!!
Thanks so much,
Stuart
#8
with web also works
your code does not work probably because qm replaces '' to " etc
this works:
Macro
Code:
Copy      Help
str jshilite=
;javascript:function H(w,s){r=w.document.body.createTextRange();for(i=0;r.findText(s);i++){r.execCommand('BackColor','','yellow');r.collapse(false);}return i;}function G(){if(frames.length==0)return document.selection.createRange().text;else for(k=0;F=frames[k];++k){u=F.document.selection.createRange().text;if(u)return u;}}function P(){var t=0,s=G();if(!s)s=prompt('Find:','');if(s){if(frames.length==0)t+=H(window,s);else for(j=0;F=frames[j];++j)t+=H(F,s);alert(t+' found.');}}P();

int hwnd = win("Dialog")

web jshilite 0 hwnd
#9
I was embarrassed to ask, but now with your latest post, I got it working perfectly with my Toolbar based Webbrowsers!!!!

Thanks so much for thinking of all the angles!!!!

Stuart
#10
http://mrclay.org/index.php/2006/04/23/ ... okmarklet/

How can I incorporate this boomarklet into Toolbar?
#11
What browser?

This is for firefox:
Function FirefoxRunBookmarklet
Code:
Copy      Help
;/
function $bookmarklet

;Runs bookmarklet in Firefox.

;bookmarklet - bookmarklet code. Must begin with "javascript:".


int w1=win(" - Mozilla Firefox" "MozillaUIWindowClass")
act w1
;select address bar, get its text, set bookmarklet text, Enter
key Ad
str sa.getsel
outp bookmarklet
key Y
;restore old text
key Ad
outp sa
key Z ;;do you know a firefox keyboard shortcut to focus current page as it was before focusing address bar?

Macro Macro1251
Code:
Copy      Help
str js=
;javascript:(function(){var%20d=document,i=0,l,em=0,ed,b=d.body,w=window,sl=[],hid=[],$=b.getElementsByTagName('*'),cTp=(d.all&&!w.opera)?'absolute':'fixed',css=d.createElement('style');css.type='text/css';css.media='all';var%20cT='#mPp{font-size:15px;padding:5px;background:#fdd;color:#000;position:'+cTp+';top:0;right:0;zIndex:1000;text-align:right}#mPp:hover{padding:.5em;line-height:1.6;}#mPp:hover%20u{display:none}#mPp%20i{display:none;text-align:left;cursor:default;color:#000}#mPp:hover%20i{display:block}#mPp%20b{border:1px%20outset%20#000;background:#fff;color:#666;padding:0%202px;margin-right:4px}#mPe{position:absolute;left:0;right:0;padding:5px%2010px;background:#fdd;text-align:left}#mPe%20textarea{width:99%;display:block}'+'.mPs,.mPs%20*{background:#ff0;color:#000;}.mPh{background:#ffc;}.mPi,.mPi%20*{background:#fff;width:auto;float:none;margin:1em%200;padding:0;}body.mPi{text-align:left;margin:0;}'.replace(/;/g,'%20!important;');if(css.styleSheet)css.styleSheet.cssText=cT;else%20css.appendChild(d.createTextNode(cT));d.getElementsByTagName('head')[0].appendChild(css);function%20nB(e){if(!e)var%20e=w.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()}function%20over(e){nB(e);!em&&!this.isSel&&changeCn(this,'mPh')}function%20out(e){nB(e);!em&&!this.isSel&&changeCn(this)}function%20clik(e){nB(e);!em&&this.isSel?unSel(this):sel(this);return%20false}while(l=$.item(i++)){addEvents(l)}var%20h=d.createElement('a');h.id='mPp';h.href='http://mrclay.org/';h.innerHTML='<u>?</u><i><b>R</b>emove%20Selected</i><i><b>U</b>ndo%20Remove</i><i><b>I</b>solate%20Selected</i><i><b>P</b>rint%20Preview</i><i><b>W</b>iden%20Selected</i><i><i><b>B</b>ackwards</i><b>N</b>ext</i><i><b>D</b>eselect</i><i><b>C</b>opy%20Element</i><i><b>E</b>dit%20HTML</i><i><b>Esc</b>ape/Quit</i>';h.onclick=function(e){nB(e)};b.appendChild(h);d.onkeydown=function(e){var%20ls=sl.length?sl[sl.length-1]:0;if(!e)var%20e=window.event;if(e.keyCode==27){rm(h);rm(css);i=0;while(l=$.item(i++)){l.onmouseover=l.oldOnmouseover||null;l.onmouseout=l.oldOnmouseout||null;l.onclick=l.oldOnclick||null;l.oldOnmouseover=null;l.oldOnmouseout=null;l.oldOnclick=null}d.onkeydown=null;em&&rm(ed)}if(em)return%20true;switch(e.keyCode){case%2082:while(sl.length){ls=sl[sl.length-1];ls.style.display='none';unSel(ls);hid.push(ls)}break;case%2073:sel(h);while(b.hasChildNodes())b.removeChild(b.firstChild);while(sl.length){b.appendChild(sl[0]);unSel(sl[0])}break;case%2087:if(ls){unSel(ls);(ls!=b)&&sel(ls.parentNode)}break;case%2080:pp();break;case%2068:unSel(ls);break;case%2085:hid.length&&(hid.pop().style.display='');break;case%2069:ls&&ls.innerHTML&&edit(ls);break;case%2066:if(ls){l=d.getElementsByTagName('*').item(getSourceIndex(ls)-1);if(l&&l!=b){unSel(ls);sel(l)}}break;case%2078:if(ls){l=d.getElementsByTagName('*').item(getSourceIndex(ls)+1);if(l&&l!=h){unSel(ls);sel(l)}}break;case%2067:if(ls){l=ls.cloneNode(true);if(ls.id){l.id+='_copy'}ls.parentNode.insertBefore(l,ls.nextSibling);addEvents(l);i=0;var%20desc;while(desc=l.getElementsByTagName('*').item(i++))addEvents(desc);unSel(ls);sel(l)}break;default:return%20true}return%20false};function%20rm(l){l.parentNode.removeChild(l)}function%20changeCn(l,cN){l.className=l.className.replace(/\bmP[hs]\b/g,'');if(cN)l.className+=l.className?'%20'+cN:cN}function%20sel(l){changeCn(l,'mPs');l.isSel='1';sl.push(l)}function%20unSel(l){changeCn(l);l.isSel='';for(var%20i=0,len=sl.length;i<len;i++){if(sl[i]==l){sl.splice(i,1);return}}}function%20edit(l){em=1;var%20left=0,top=0,tmp=l,chg=0;if(tmp.offsetParent){while(tmp.offsetParent){left+=tmp.offsetLeft;top+=tmp.offsetTop;tmp=tmp.offsetParent}}ed=d.createElement('div');ed.id='mPe';b.appendChild(ed);ed.style.top=(top+l.offsetHeight+5)+'px';unSel(l);var%20oh=getOuterHTML(l).replace(/^\s*|\s*$/g,'').replace(/%20isSel[<>]*\u003E/g,'>').replace(/%20class=""(?=[^<>]*>)/g,'');sel(l);var%20rows=Math.min(15,oh.split('\n').length+3);ed.innerHTML='<textarea%20id=mPta%20rows='+rows+'></textarea><button%20id=mPbu>done</button>';d.getElementById('mPta').value=oh;d.getElementById('mPta').onchange=function(){chg=1};function%20finEdit(){unSel(l);em=0;if(chg){var%20tmp=b.appendChild(d.createElement('div'));tmp.innerHTML=d.getElementById('mPta').value;i=0;var%20desc;while(desc=tmp.getElementsByTagName('*').item(i++))addEvents(desc);while(tmp.hasChildNodes())l.parentNode.insertBefore(tmp.firstChild,l);rm(l);rm(tmp)}rm(ed)}d.getElementById('mPbu').onclick=d.getElementById('mPbu').onkeypress=finEdit}function%20addEvents(l){if('String'!=typeof%20l.isSel){l.isSel='';l.oldOnmouseover=l.onmouseover;l.oldOnmouseout=l.onmouseout;l.oldOnclick=l.onclick;l.onmouseover=over;l.onmouseout=out;l.onclick=clik}}function%20getSourceIndex(l){if(l.sourceIndex)return%20l.sourceIndex;i=0;var%20el;while(el=d.getElementsByTagName('*').item(i)){if(el==l)return%20i;++i}}function%20getOuterHTML(l){if(l.outerHTML)return%20l.outerHTML;var%20dv=d.createElement('div');dv.appendChild(l.cloneNode(true));return%20dv.innerHTML}function%20pp(){var%20i=0,m,ss=d.styleSheets,wk=/webkit/i.test(navigator.userAgent);if(ss&&!wk){for(i=0;i<ss.length;i++){m=ss[i].media;if(m.mediaText)m.mediaText=media(m.mediaText);else%20ss[i].media=media(m)}}else{ss=[];var%20r,l;while(l=d.getElementsByTagName('link').item(i++)){r=l.getAttribute('rel');if(r&&/^style/i.test(r))ss.push(l)}i=0;while(l=d.getElementsByTagName('style').item(i++))ss.push(l);for(i=ss.length-1;i>=0;i--){if(wk)handleWk(ss[i]);else%20ss[i].media=media(ss[i].media)}}function%20media(m){return(m=='all')?m:(/projection/.test(m))?'print':(/speech/.test(m))?'screen':(/print/.test(m))?'screen,print,projection':'speech'}function%20handleWk(l){if(/print/.test(l.media)){var%20n=l.cloneNode(true);n.media='screen';l.parentNode.appendChild(n)}else%20if(/screen/.test(l.media)){l.disabled=true}}}})();
FirefoxRunBookmarklet js
#12
For web browser in QM dialog:
Function Dialog81
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str ax3SHD
ax3SHD="www.google.com"
if(!ShowDialog("Dialog81" &Dialog81 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 465 361 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 468 346 "SHDocVw.WebBrowser"
;4 Button 0x54032000 0x0 0 347 48 14 "Button"
;END DIALOG
;DIALOG EDITOR: "" 0x2030103 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 4
,str js=
;javascript:(function(){var d=document,s=d.createElement('script');s.src='http://mrclay.org/js/bookmarklets/myPage_1_1.min.js';s.type='text/javascript';d.body.appendChild(s)})();
,web js 0 hDlg
,case IDOK
,case IDCANCEL
ret 1
#13
Why not work?

Function Dialog81
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages


str- js=
;javascript:(function(){var%20d=document,i=0,l,em=0,ed,b=d.body,w=window,sl=[],hid=[],$=b.getElementsByTagName('*'),cTp=(d.all&&!w.opera)?'absolute':'fixed',css=d.createElement('style');css.type='text/css';css.media='all';var%20cT='#mPp{font-size:15px;padding:5px;background:#fdd;color:#000;position:'+cTp+';top:0;right:0;zIndex:1000;text-align:right}#mPp:hover{padding:.5em;line-height:1.6;}#mPp:hover%20u{display:none}#mPp%20i{display:none;text-align:left;cursor:default;color:#000}#mPp:hover%20i{display:block}#mPp%20b{border:1px%20outset%20#000;background:#fff;color:#666;padding:0%202px;margin-right:4px}#mPe{position:absolute;left:0;right:0;padding:5px%2010px;background:#fdd;text-align:left}#mPe%20textarea{width:99%;display:block}'+'.mPs,.mPs%20*{background:#ff0;color:#000;}.mPh{background:#ffc;}.mPi,.mPi%20*{background:#fff;width:auto;float:none;margin:1em%200;padding:0;}body.mPi{text-align:left;margin:0;}'.replace(/;/g,'%20!important;');if(css.styleSheet)css.styleSheet.cssText=cT;else%20css.appendChild(d.createTextNode(cT));d.getElementsByTagName('head')[0].appendChild(css);function%20nB(e){if(!e)var%20e=w.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()}function%20over(e){nB(e);!em&&!this.isSel&&changeCn(this,'mPh')}function%20out(e){nB(e);!em&&!this.isSel&&changeCn(this)}function%20clik(e){nB(e);!em&&this.isSel?unSel(this):sel(this);return%20false}while(l=$.item(i++)){addEvents(l)}var%20h=d.createElement('a');h.id='mPp';h.href='http://mrclay.org/';h.innerHTML='<u>?</u><i><b>R</b>emove%20Selected</i><i><b>U</b>ndo%20Remove</i><i><b>I</b>solate%20Selected</i><i><b>P</b>rint%20Preview</i><i><b>W</b>iden%20Selected</i><i><i><b>B</b>ackwards</i><b>N</b>ext</i><i><b>D</b>eselect</i><i><b>C</b>opy%20Element</i><i><b>E</b>dit%20HTML</i><i><b>Esc</b>ape/Quit</i>';h.onclick=function(e){nB(e)};b.appendChild(h);d.onkeydown=function(e){var%20ls=sl.length?sl[sl.length-1]:0;if(!e)var%20e=window.event;if(e.keyCode==27){rm(h);rm(css);i=0;while(l=$.item(i++)){l.onmouseover=l.oldOnmouseover||null;l.onmouseout=l.oldOnmouseout||null;l.onclick=l.oldOnclick||null;l.oldOnmouseover=null;l.oldOnmouseout=null;l.oldOnclick=null}d.onkeydown=null;em&&rm(ed)}if(em)return%20true;switch(e.keyCode){case%2082:while(sl.length){ls=sl[sl.length-1];ls.style.display='none';unSel(ls);hid.push(ls)}break;case%2073:sel(h);while(b.hasChildNodes())b.removeChild(b.firstChild);while(sl.length){b.appendChild(sl[0]);unSel(sl[0])}break;case%2087:if(ls){unSel(ls);(ls!=b)&&sel(ls.parentNode)}break;case%2080:pp();break;case%2068:unSel(ls);break;case%2085:hid.length&&(hid.pop().style.display='');break;case%2069:ls&&ls.innerHTML&&edit(ls);break;case%2066:if(ls){l=d.getElementsByTagName('*').item(getSourceIndex(ls)-1);if(l&&l!=b){unSel(ls);sel(l)}}break;case%2078:if(ls){l=d.getElementsByTagName('*').item(getSourceIndex(ls)+1);if(l&&l!=h){unSel(ls);sel(l)}}break;case%2067:if(ls){l=ls.cloneNode(true);if(ls.id){l.id+='_copy'}ls.parentNode.insertBefore(l,ls.nextSibling);addEvents(l);i=0;var%20desc;while(desc=l.getElementsByTagName('*').item(i++))addEvents(desc);unSel(ls);sel(l)}break;default:return%20true}return%20false};function%20rm(l){l.parentNode.removeChild(l)}function%20changeCn(l,cN){l.className=l.className.replace(/\bmP[hs]\b/g,'');if(cN)l.className+=l.className?'%20'+cN:cN}function%20sel(l){changeCn(l,'mPs');l.isSel='1';sl.push(l)}function%20unSel(l){changeCn(l);l.isSel='';for(var%20i=0,len=sl.length;i<len;i++){if(sl[i]==l){sl.splice(i,1);return}}}function%20edit(l){em=1;var%20left=0,top=0,tmp=l,chg=0;if(tmp.offsetParent){while(tmp.offsetParent){left+=tmp.offsetLeft;top+=tmp.offsetTop;tmp=tmp.offsetParent}}ed=d.createElement('div');ed.id='mPe';b.appendChild(ed);ed.style.top=(top+l.offsetHeight+5)+'px';unSel(l);var%20oh=getOuterHTML(l).replace(/^\s*|\s*$/g,'').replace(/%20isSel[<>]*\u003E/g,'>').replace(/%20class=""(?=[^<>]*>)/g,'');sel(l);var%20rows=Math.min(15,oh.split('\n').length+3);ed.innerHTML='<textarea%20id=mPta%20rows='+rows+'></textarea><button%20id=mPbu>done</button>';d.getElementById('mPta').value=oh;d.getElementById('mPta').onchange=function(){chg=1};function%20finEdit(){unSel(l);em=0;if(chg){var%20tmp=b.appendChild(d.createElement('div'));tmp.innerHTML=d.getElementById('mPta').value;i=0;var%20desc;while(desc=tmp.getElementsByTagName('*').item(i++))addEvents(desc);while(tmp.hasChildNodes())l.parentNode.insertBefore(tmp.firstChild,l);rm(l);rm(tmp)}rm(ed)}d.getElementById('mPbu').onclick=d.getElementById('mPbu').onkeypress=finEdit}function%20addEvents(l){if('String'!=typeof%20l.isSel){l.isSel='';l.oldOnmouseover=l.onmouseover;l.oldOnmouseout=l.onmouseout;l.oldOnclick=l.onclick;l.onmouseover=over;l.onmouseout=out;l.onclick=clik}}function%20getSourceIndex(l){if(l.sourceIndex)return%20l.sourceIndex;i=0;var%20el;while(el=d.getElementsByTagName('*').item(i)){if(el==l)return%20i;++i}}function%20getOuterHTML(l){if(l.outerHTML)return%20l.outerHTML;var%20dv=d.createElement('div');dv.appendChild(l.cloneNode(true));return%20dv.innerHTML}function%20pp(){var%20i=0,m,ss=d.styleSheets,wk=/webkit/i.test(navigator.userAgent);if(ss&&!wk){for(i=0;i<ss.length;i++){m=ss[i].media;if(m.mediaText)m.mediaText=media(m.mediaText);else%20ss[i].media=media(m)}}else{ss=[];var%20r,l;while(l=d.getElementsByTagName('link').item(i++)){r=l.getAttribute('rel');if(r&&/^style/i.test(r))ss.push(l)}i=0;while(l=d.getElementsByTagName('style').item(i++))ss.push(l);for(i=ss.length-1;i>=0;i--){if(wk)handleWk(ss[i]);else%20ss[i].media=media(ss[i].media)}}function%20media(m){return(m=='all')?m:(/projection/.test(m))?'print':(/speech/.test(m))?'screen':(/print/.test(m))?'screen,print,projection':'speech'}function%20handleWk(l){if(/print/.test(l.media)){var%20n=l.cloneNode(true);n.media='screen';l.parentNode.appendChild(n)}else%20if(/screen/.test(l.media)){l.disabled=true}}}})();

str controls = "3"
str ax3SHD
ax3SHD="www.google.com"
if(!ShowDialog("Dialog81" &Dialog81 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 465 361 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 468 346 "SHDocVw.WebBrowser"
;4 Button 0x54032000 0x0 0 347 48 14 "Button"
;END DIALOG
;DIALOG EDITOR: "" 0x2030103 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 4
,web js 0 hDlg
,case IDOK
,case IDCANCEL
ret 1
#14
It is firefox bookmarklet version.
#15
Ok. I was looking for this function to IE.
#16
Quote:It is firefox bookmarklet version.

Are you sure?

In the web page...

Tested in FF1.0, Safari1.2 & Opera 8.5… and IE6!
Inspired by the Aardvark Firefox extension. They now have a bookmarklet version, but I find it too buggy In Opera.
uncompressed source available
#17
Not sure but it did not work in web browser control. The IE version did work.


Forum Jump:


Users browsing this thread: 1 Guest(s)