![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hello Dave, According to your description, what you need is to add a new entry into IE context menu.When clicked on this new entry, it launches another copy of IE to the url which we selected. If I misunderstood anything here, please feel to correct me. If this is the case, you may refer to the following article http://msdn2.microsoft.com/en-us/library/aa753589.aspx [Adding Entries to the Standard Context Menu] At first, we should add a new entry into Windows Register. [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\New Test] @="C:\\ mytest.html" Then, copy the following code snippet as mytest.html on your disk. SCRIPT LANGUAGE="JavaScript" defer var parentwin = external.menuArguments; var doc = parentwin.document; var sel = doc.selection; var rng = sel.createRange(); var str = new String(rng.text); var regex = /^http:\/\//; if(str.length==0) { // if we didn't get a page assume the current one. str = doc.URL; } if(! regex.test(str)) { str = "http://" + str; } //open(external.menuArguments.location.href=str); windows.open(window.location.href=str); /SCRIPT Last, please restart your IE. You will notice there is a new entry "New Test" on the context menu. But, please note the entry we inserted into Context Menu is only on one level. We cannot create them as Script/Program/???. Hope this helps. Please feel free to let me know if there is anything unclear or you face any further issue. We are glad to assist you. Have a great day, Best regards, Wen Yuan Microsoft Online Community Support ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Hello Dave, According to your description, what you need is to add a new entry into IE context menu.When clicked on this new entry, it launches another copy of IE to the url which we selected. If I misunderstood anything here, please feel to correct me. If this is the case, you may refer to the following article http://msdn2.microsoft.com/en-us/library/aa753589.aspx [Adding Entries to the Standard Context Menu] At first, we should add a new entry into Windows Register. [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\New Test] @="C:\\ mytest.html" Then, copy the following code snippet as mytest.html on your disk. SCRIPT LANGUAGE="JavaScript" defer var parentwin = external.menuArguments; var doc = parentwin.document; var sel = doc.selection; var rng = sel.createRange(); var str = new String(rng.text); var regex = /^http:\/\//; if(str.length==0) { // if we didn't get a page assume the current one. str = doc.URL; } if(! regex.test(str)) { str = "http://" + str; } //open(external.menuArguments.location.href=str); windows.open(window.location.href=str); /SCRIPT Last, please restart your IE. You will notice there is a new entry "New Test" on the context menu. But, please note the entry we inserted into Context Menu is only on one level. We cannot create them as Script/Program/???. Hope this helps. Please feel free to let me know if there is anything unclear or you face any further issue. We are glad to assist you. Have a great day, Best regards, Wen Yuan Microsoft Online Community Support ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Hi Dave, Note the javascript in the html file can use ActiveX components to do various stuff. I don't think you have to create a full IE add-on (called Browser Helper Object, BHO for short) to do this. Of course, this will depend on your detailed requirement. For example: SCRIPT var shell = new ActiveXObject("WScript.Shell"); shell.run("iexplore \"" + external.menuArguments.document.URL + "\""); /SCRIPT Let me know which method do you want to use and we can discuss more about that. Regards, Walter Wang (wawang (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#9
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |