General :  K-Meleon Web Browser Forum
General discussion about K-Meleon. Questions about how to setup it, macro coding, all related to its usage and the project itself, including this website. 
open k-meleon from ie
Posted by: Brian
Date: April 02, 2005 08:17PM

ok, there's an option to open any page or link in IE from K-Meleon. Is there a way to do this the opposite way(open a page in K-Meleon from IE). I know that some registry editing would be required. Particularly in:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\
and in:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MenuExt\

Does anybody know what to do from there...?

Brian

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: everling
Date: April 02, 2005 10:45PM

I don't have the MenuExt in my registry. Probably because I barely used IE since my fresh reinstall.

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: Brian
Date: April 02, 2005 11:33PM

wow- i actually found out how to do it! ok- i didn't figure out to do it from a link yet, but i'll figure that out soon enough.

instructions on how to open a page from IE in k-meleon:

1. Create an html document anywhere on your computer(preferrably somewhere hidden... like the k-meleon program files folder[c:\program files\k-meleon\]. To create an html document, right click while in a folder and go to "New" then to "Text Document". When a new file comes up, rename it to "viewinkmeleon.html" If you have extensions turned off, go to "Tools", then "Folder Options" then click on the "View" tab and uncheck the "Hide extensions for known file types" box. Click "Ok". It should show file extensions now. Umm... anyway. Now, if there's not a file in the folder named "viewinkmeleon.html"... just give up now, lol.

2. Insert the following text into the file by clicking "edit" when you right click the html file... or by opening up the file with notepad:

<SCRIPT LANGUAGE="JavaScript">

var shell = new ActiveXObject("WScript.Shell");
shell.run("\"C:/Program Files/K-Meleon/k-meleon.exe\" \"" + external.menuArguments.document.URL + "\"");

// shell.run("opera \"" + external.menuArguments.document.URL + "\"");

</SCRIPT>



3. Save changes and close the file

4. Click the start button, and go to "Run.."

5. type "regedit" in the box... WITHOUT the quotes, of course.

6. Navigate your way to:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt

7. Once you find this, right click on "MenuExt" and go to "New" then select "Key" which should be at the very top.

8. Name the new registry key "Open In &K-Meleon" or whatever you want it to show up as on the menu in internet explorer. By the way, if you put the & symbol in front of a letter, it will select that option when you push the key of the letter which you put the & symbol in front of.

9. Off to the right side of the Registry Editor, there should be a big open space with one item at the top named "(Default)". Right click on "(Default)" and select Modify. Either that, or just double click on it. A small box should come up with two input boxes. It's ok if the "Value name:" box is greyed out... it's not necessary to edit that.

10. In the "Value data:" input box, put the location of the "viewinkmeleon.html" file. Example: "C:\Program Files\K-meleon\viewinkmeleon.html". After you've put the file location in, click "Ok."

11. Once you have that done, you can close everything and open up Internet Explorer. Try it out. Right click on a page in Internet Explorer and go down to "Open in K-meleon" or whatever you decided to name this in the registry. If it opens up in K-meleon, that's great!

If not....

1. You must not have installed K-meleon to the default directory. Try changing the path(C:/Program Files/K-Meleon/k-meleon.exe) in the "viewinkmeleon.html" to wherever your k-meleon installation is located. MAKE SURE TO USE FORWARD SLASHES, LIKE ME!

2. Check the registry entry you created to see if the "Value data:" matches the filename/location. You can use backslashes here.

3. ?? I have no idea. I just wanted to have a #3 on here.


Brian

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: Brian
Date: April 02, 2005 11:44PM

oh,... and umm- by the way... i just realized that i left this in the "viewinkmeleon.html" file. you can delete it or leave it. it won't make a difference, but just in case, i'd recommend deleting it.

// shell.run("opera \"" + external.menuArguments.document.URL + "\"");


^^ delete that inside of the "viewinkmeleon.html" file

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: Brian
Date: April 03, 2005 12:15AM

i'm officially a genius. Ok- not really... because i didn't do any of the coding, but i did happen to put it all together and make it work:-). I used a little bit of the code from here... more specifically in the firefox plugin.:

http://www.unixdaemon.net/ie_plugins.html#viewin_plugin

Thanks Dean Wilson!

Anyway, just follow the same steps as above, except name the new registry key "View &LINK In K-Meleon" instead. Also, instead of using that code from above... you're gonna have to use this code:

<SCRIPT LANGUAGE="JavaScript">
function runK(location) {

var shell = new ActiveXObject("WScript.Shell");
shell.run("\"C:/Program Files/K-Meleon/k-meleon.exe\" \"" + location + "\"");

}

var oWindow = window.external.menuArguments;
if (oWindow != null) {
var oDocument = oWindow.document;
var sText = null;

var oEvent = oWindow.event;
if ((oEvent.type == "MenuExtUnknown") || (oEvent.type == "MenuExtImage") || (oEvent.type == "MenuExtAnchor")) {
var oElement = oDocument.elementFromPoint(oEvent.clientX, oEvent.clientY);
var oAnchor = oElement;
while ((oAnchor.tagName != "A") && (oAnchor.tagName != "AREA") && (oAnchor.tagName != "HTML")) {
oAnchor=oAnchor.parentElement;
}

if (oAnchor.tagName=="A" || oAnchor.tagName=="AREA") {
sText = oAnchor.href;
} else if (oAnchor.tagName=="HTML" && oElement.tagName=="IMG") {
sText = oElement.src;
}
}


if ((sText != null) && (sText.length != 0)) {
var location = new String(sText);
runK(location);
}
}
</SCRIPT>





Well- umm... also make sure you use a different filename such as "viewlinkinkmeleon.html". Good luck! Any problems... come back here- it's a forum... :-D.

Brian

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: 666
Date: April 03, 2005 02:15AM

Great job, Brian!

I would add one more thing to the registry:

For the 'View Link In K-Meleon' entry, make a D-Word (will appear under the default entry), call it "contexts", and set the value to 0x00000020 (32) .

Now the 'view link' option will only appear when you right-click a link.

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: Brian
Date: April 03, 2005 02:23AM

AWESOME!!! I was WONDERING how to do that. Thank you so much!

Brian

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: Brian
Date: April 03, 2005 02:31AM

I ended up having to go to "Modify Binary Data" and make it to where the binary data looked like this:

20 00 00 00

That was the only way i could get it to work, but at least it worked! Thanks!

Brian

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: Brian
Date: April 03, 2005 02:43AM

never mind. it didn't work for me. i'm on windows xp sp2. that could be the reason for it. i don't know how i would. I actually think for windows xp, you need to do something like this:

1. Create a DWORD
2. Name it "contexts"(like he said)
3. Double click the file or right click and go to "Modify"
4. Type "22" into the box... WITHOUT quotes, of course.
5. Leave it as hexadecimal.
6. Click "Ok"

Now, it should have something like this as the data:

0x00000022 (34)

I hope this works for those of you on Windows XP.

Brian

PS- if this doesn't work, try typing 20 instead of 22

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: 666
Date: April 03, 2005 03:00AM

Oops. I forgot. The '20' should be in the hexadecimal box when you click 'modify.'

20 hexadecimal = 32 decimal.

There's one little problem. If the link is an image, it doesn't work. To fix this, set the DWORD to 22 instead of 20.

To make the right-click-menu of links only show 'open link in K-M' without the 'open in K-M' part, add a contexts DWORD to the 'open in k-meleon' key and set it to 1.


To recap it all:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Open in K-Meleon
Default = "C:\Program Files\K-meleon\viewinkmeleon.html"
DWORD "contexts" = "1" (hexadecimal or decimal)

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Open Link in K-Meleon
Default = "C:\Program Files\K-meleon\viewlinkinkmeleon.html"
DWORD "contexts" = "22" (hexadecimal) or 34 (decimal)


More on IE menu extensions: http://msdn.microsoft.com/workshop/browser/ext/tutorials/context.asp

Options: ReplyQuote
Re: open k-meleon from ie
Posted by: Brian
Date: April 03, 2005 05:46PM

awesome:-).

Brian

Options: ReplyQuote


K-Meleon forum is powered by Phorum.