<< Previous Topic | Next Topic >>  

More context menu options...

July 20 2003 at 2:03 PM
Phil  (Login mrpip)
Forum Owner

 
Add Browser Source to your context menu: View the source code after the browser has rendered it, an example to view the web pages source code and the browsers rendered source code can be seen here at the bottom of the page.

browsersrc.htm:
<SCRIPT LANGUAGE="JavaScript" defer>
var viewWin; var docSource;
docSource = external.menuArguments.document.all.tags("HTML")[0].outerHTML
viewWin=window.open("","sourceWin","width=800,height=600,scrollbars=yes,resizable=yes");
viewWin.document.write("<html><basefont size=2 family=Verdana><title>Browser Source</title><body></body></html>");
viewWin.document.close();
viewWin.document.body.innerText = docSource;
</SCRIPT>



browsersrc.reg
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Show &Browser Source]
@="file://c:\\windows\\Web\\browsersrc.htm"
"Contexts"=dword:00000001



Create and copy the code to the files and save them to the windows\web folder, if saving to another location change the path in the reg file to reflect there new location


    
This message has been edited by mrpip on Jul 20, 2003 2:26 PM


 
 Respond to this message   
AuthorReply
Phil
(Login mrpip)
Forum Owner

Re: More context menu options...

July 20 2003, 2:22 PM 

Add Mark Text to your context menu: Is similar to the "Find" prompt on the edit menu except "Mark Text" does not search the 1st found then goes to what it found but search's the whole page and highlights all references it finds at once, which I find comes in handy on big pages.

marktext.htm:
<SCRIPT>
var parentWin = external.menuArguments;
var parentDoc = parentWin.document;
var searchText = parentWin.prompt("Text to mark:","");
if (searchText != null && searchText != ''){
var searchRange = parentDoc.body.createTextRange();
for (i=0; searchRange.findText(searchText)!=false; i++){
searchRange.pasteHTML("<span style='background:#66FF66;'>" + searchRange.text + "</span>");
}
parentWin.alert(i + " items marked.");}
else{alert("Nothing to mark!");}
</SCRIPT>



marktext.reg:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Mark Te&xt]
@="file://c:\\windows\\web\\marktext.htm"
"Contexts"=dword:00000001



Create and copy the code to the files and save them to the windows\web folder, if saving to another location change the path in the reg file to reflect there new location

 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

Re: More context menu options...

July 20 2003, 2:39 PM 

Add Google to your context menu: By highlighting text on a page and selecting Google will open a new window to google searching the highlighted text, and if you select Google without highlighting any text the a prompt will display asking for your search term.

google.html:
<script language="javascript" defer>
var parentWin = external.menuArguments;
var parentDoc = parentWin.document;
var select = parentDoc.selection;
var selectedtext = select.createRange().text;
if(selectedtext){open("http://www.google.com/search?q="+escape(selectedtext)+"&num=50")}
else{
void(q=parentWin.prompt('Enter text to search using Google. You can also highlight a word on this web page before clicking Google.',''));
if(q)open('http://www.google.com/search?q='+escape(q)+'&num=50')
}
</script>



google.reg:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Google]
@="file://C:\\windows\\web\\google.html"
"contexts"=dword:00000011



Create and copy the code to the files and save them to the windows\web folder, if saving to another location change the path in the reg file to reflect there new location

 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

And another...

July 20 2003, 4:04 PM 

Add View Link Source to your context menu: View the source code of web pages without going to the site by right clicking on hyperlinks and hyperlinked images or highlighting URL's which are in plain text.

linksource.html:
<script language="javascript" defer>
if (external.menuArguments){
var selectedtext = external.menuArguments.document.selection.createRange().text;
if(selectedtext){
if(selectedtext.match("http://") ) window.open('view-source:' + selectedtext);
else window.open('view-source:http://' + selectedtext); }
else{
var clickelement = external.menuArguments.event.srcElement;
if ( clickelement.tagName == 'IMG' )
window.open('view-source:' + clickelement.parentElement.href);
else window.open('view-source:' + clickelement.href); }}
</script>



linksource.reg:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\View Link Source]
@="C:\\windows\\web\\linksource.html"
"contexts"=dword:00000032



Create and copy the code to the files and save them to the windows\web folder, if saving to another location change the path in the reg file to reflect there new location

 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

Re: More context menu options...

July 20 2003, 4:30 PM 

Add Safe Frame to your context menu: When you select "Safe Frame" on a hyperlink, it will open the hyperlink in a new window inside an iframe which has its security set to restricted, (using your settings in the Internet Explorer's Restricted Sites Zone). An example of a Safe Viewer using your IE's Restricted Sites Zone.
This allows me to view sites I deem unsafe.

safeframe.htm:
<SCRIPT LANGUAGE="JavaScript" defer>
var safeWin, suspectLink;
suspectLink = external.menuArguments.event.srcElement.href
safeWin=window.open("","safeWin","width=800,height=600,scrollbars=no,resizable=yes,status=yes");
safeWin.document.write("<html><title>Safe Browse</title><body bgcolor=red topmargin=5 rightmargin=5 bottommargin=5 leftmargin=5 border=0>");
safeWin.document.write("<iframe id=i1 name=i1 security='restricted' style='width:100%; height:100%;'></iframe>");
safeWin.document.write("</body></html>");
safeWin.document.close();
if (suspectLink.indexOf("@") > 0){safeWin.window.alert("This is a mailto link! " + suspectLink); safeWin.close();}
else{safeWin.document.all.i1.src = suspectLink;}
</SCRIPT>



safeframe.reg:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Safe Frame]
@="file://c:\\windows\\web\\safeframe.htm"
"Contexts"=dword:00000020



Create and copy the code to the files and save them to the windows\web folder, if saving to another location change the path in the reg file to reflect there new location

 
 Respond to this message   

(Login BilgeRat)

Really amazing

July 21 2003, 9:26 PM 

what you enable us to do here... havent found time to create those last files of yours ( have beeen busy with my buttons yesterday http://www.network54.com/Hide/Forum/257255 ) but I think I will add them to my menu, they are looking good to me. Well done, Phil!

~~~ help line ~
http://www.network54.com/Realm/n54_files/n54_links.html

 
 Respond to this message   

(Login BilgeRat)

now..

July 22 2003, 11:26 AM 

I'd added these. Very comfortable. Thanks, Phil

 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

And one more...

July 22 2003, 11:56 AM 

on my context menu I forget to add... Links List This one display's all the links on the page beeing viewed in a popup window. Saves me alot of time when searching for a link(s) on pages that have way to may links per page such as my home page lol

urllist.htm:
<script language=javascript defer>
var dlProgress=window.open("", "_blank", "scrollbars=yes, resizable=yes, status=yes, width=400, height=600");
dlProgress.document.open();
dlProgress.document.write ("<html><head><title>Links list</title></head><body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>");
dlProgress.document.write ("<font style=\"font:8pt Verdana, Arial, Helvetica, Sans-serif; line-height:12pt;\">");
dlProgress.document.write ("<script language=javascript>function navigateClose(str){if (document.my_parent != null){document.my_parent.location.href=str;window.close();}else{alert(\"Please wait until the list has populated.\");}}<\/script>");
dlProgress.document.write ("&nbsp;List of all links in <b>" + external.menuArguments.document.title + "</b>:<ol>");
var links = external.menuArguments.document.links;
for (i = 0; i < links.length; i++){
if ( links(i).innerText != "" && links(i).innerText != " "){
dlProgress.document.write ("<li><A HREF='javascript:navigateClose(\"" + links(i).href + "\")' TITLE=" + links(i).href + ">" + links(i).innerText + "</a><BR>");}
else{dlProgress.document.write("<li><A HREF='javascript:navigateClose(\"" + links(i).href + "\")'>" + links(i).href + "</a><BR>");}
}
dlProgress.document.write ("</ol><center><a href='javascript:window.close()' style=\"color:#FF0000;text-decoration:none\">close</a></center><BR></body>");
dlProgress.document.write ("</font></html>");
dlProgress.document.close();
dlProgress.document.my_parent = external.menuArguments;
</script>



urllist.reg:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&Links List]
@="file://c:\\windows\\web\\urllist.htm"
"Contexts"=dword:00000001



Create and copy the code to the files and save them to the windows\web folder, if saving to another location change the path in the reg file to reflect there new location

 
 Respond to this message   
Current Topic - More context menu options...
  << Previous Topic | Next Topic >>  
Find more forums on Personal Web PagesCreate your own forum at Network54
 Copyright © 1999-2010 Network54. All rights reserved.   Terms of Use   Privacy Statement