General :  K-Meleon Forum
General discussion about K-Meleon. 
[SOLVED] [Send Link To] : Add an item...
Posted by: melo
Date: January 05, 2012 06:12PM

Hi,

K-MELEON 1.1.6

When right clicking an URL link, sub-menu shows "Send Link To" > "Internet Explorer"
How can I add another browser here, i.e. FireFox ?
This seems depending on sendto.kmm but here I can't find Internet Explorer listed...

TIA
Regards.



Edited 2 time(s). Last edit at 01/07/2012 04:33PM by melo.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: JamesD
Date: January 05, 2012 08:18PM

There are a couple of ways to do this. I choose to copy the ie.kmm file and modify it for Blackhawk browser. There may be an extension to allow this to be done another way.

BlackHawk.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)

# ----------  BlackHawk.kmm ---------------------------------------------------------------------------
#
# Dependencies	: main.kmm (Go), sendto.kmm (menus)
# Resources	: -
# Preferences	: -
# Author and date  JamesD  2011-12-03
# ------------------------------------------------------------------------------------------------------------------

BlackHawk_OpenPage{
macroinfo=_("Open page in BlackHawk");
$_BlackHawk_Open=$URL;      &_BlackHawk_Open;
}
BlackHawk_OpenLink{
macroinfo=_("Open link in BlackHawk");
$_BlackHawk_Open=$LinkURL;  &_BlackHawk_Open;
}
BlackHawk_OpenURL{
macroinfo=_("Open URL Bar contents in BlackHawk");
$__text=$URLBAR; $__text==""?$__text=$URL:0;
$_BlackHawk_Open=$__text;   &_BlackHawk_Open;
}

# ----- PRIVATE  

_BlackHawk_Open{
# try to locate the Program Files directory:
$__data=readreg("HKLM","SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir");
$__data==""?$__data="C:\\"._("Program Files"):0;
# fallback command line:
$_BH="\"".$__data."\\NETGATE\\Black Hawk\\blackhawk.exe\" %1";
# try to get command line from the registry:
$__data=readreg("HKCR","Applications\\blackhawk.exe\\shell\\open\\command\\");
# catch invalid IE7 registry data:
index($__data,".")>index($__data,"%1")?$__data="":0;
$__data==""?0:$_BH=$__data; exec(sub("%1",urldecode($_BlackHawk_Open),$_BH));
}

_BlackHawk_BuildMenu{
index($macroModules,";SendTo;")>-1?&_BlackHawk_BuildMenu_SendTo:&_BlackHawk_BuildMenu_Default;
}
_BlackHawk_BuildMenu_Default{
$__m="Open In &BlackHawk";
setmenu(DocumentOpenExternal,macro,$__m,BlackHawk_OpenPage);
setmenu(LinkOpenExternal,macro,$__m,BlackHawk_OpenLink);
setmenu(_Go_Open,macro,$__m,BlackHawk_OpenURL);
}
_BlackHawk_BuildMenu_SendTo{
$__m="&BlackHawk";
setmenu($_SendTo_Page,macro,$__m,BlackHawk_OpenPage);
setmenu($_SendTo_Link,macro,$__m,BlackHawk_OpenLink);
setmenu($_SendTo_URL,macro,$__m,BlackHawk_OpenURL);
}

$OnInit=$OnInit."_BlackHawk_BuildMenu;";
# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."BlackHawk;";


Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: melo
Date: January 05, 2012 09:05PM

Thanks, brotha !
With your help, have found "ie.kmm"...
Now, I'll try changing all IE to FireFox in a copy of this macro as done by you for Blackhawk browser.
I'll say if that work.
Thanks for helping.



Edited 1 time(s). Last edit at 01/05/2012 09:06PM by melo.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: melo
Date: January 06, 2012 08:11PM

Hi,

I have tested the two ways to allow sending link to FIREFOX but all failed.
Perhaps because FireFox is a portable version and not a normal install...

1) JamesD method : tweaking ie.kmm =

Have changed all BlackHawk in BlackHawk.kmm to FireFox then changed browser path and registry key.

Clicking on FireFox leads to many errors :

"Left hand of assignment must be a variable"
"The expression '$__data==""?$__data="C:\\"._("Program Files"):0' is a badly formed conditional expression."
"Command not found 'urldecode'"

then FireFox opens in C:\Documents and Settings\owner folder (I am on WINXP).

2) Jujuland extension =
http://extensions.geckozone.org/KMES-FirefoxEn

As expected for an manual install, FireFox name is greyed.
Ungreyed after entering path and command manually but nothing happens when FireFox is clicked on a link...

Too hard for a noob like me, I give up...
Thanks, JamesD, for your kind help.



Edited 1 time(s). Last edit at 01/06/2012 09:57PM by melo.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: adodupan
Date: January 06, 2012 11:25PM

browser.kmm for km11. Differences: after selecting another browser, you need to restart your km.



Edited 1 time(s). Last edit at 01/06/2012 11:27PM by adodupan.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: melo
Date: January 07, 2012 01:57AM

Thanks, adodupan...

Fail !

What I have done :
Stop KM 1.1.6
In kplugins :
Replace macros.dll
In macros :
Add browser.kmm & ExecMacros_List.kmm
Start KM

Result :
"Bad character in macro name.
In file exemacros_list.kmm at line 24"
"Bad character in macro name.
In file browser.kmm at line 38"
Then :
Twice in link right menu :
"Send Link URL"
"Send Link To" with twice "Internet Explorer" !
"Link Properties"

I have made no change manually in ExecMacros_List.kmm
Regards.



Edited 1 time(s). Last edit at 01/07/2012 01:57AM by melo.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: JamesD
Date: January 07, 2012 03:07AM

@ melo

What is the complete path to your firefox executable?

Quote
melo
"Left hand of assignment must be a variable"
"The expression '$__data==""?$__data="C:\\"._("Program Files"):0' is a badly formed conditional expression."
"Command not found 'urldecode'"

That conditional expression is unchanged from ie.kmm. I don't know where the error comes from.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: adodupan
Date: January 07, 2012 04:09AM

melo, best scenario for you:
Read about browser.kmm
Download a new zip package km11 and extract it to a new folder
Remember this as profile.ini in km root folder
----------------------------------------------
[Profile]
Path=meloProfiles
IsRelative=1
[General]
StartWithLastProfile=1
----------------------------------------------

Extract browser_km11.7z
Start km and choose browser that you want [Tools > Open in browser > Add a new browser]
Restart km
Right click, open in 'your chosen browser'
After this, if you are still have trouble, you wait for Nick's response, he have more patience :)



Edited 1 time(s). Last edit at 01/07/2012 04:14AM by adodupan.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: melo
Date: January 07, 2012 02:32PM

Quote
JamesD

What is the complete path to your firefox executable?

Folder :
C:\Program Files\Firefox_7.0b5_English_Portable
Portable exe :
C:\Program Files\Firefox_7.0b5_English_Portable\FirefoxPortable.exe
Real exe :
C:\Program Files\Firefox_7.0b5_English_Portable\App\Firefox\firefox.exe

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: JujuLand
Date: January 07, 2012 03:17PM

Here is the content of my version that I have written there is a long time. It allows to automatically keep the location of Firefox,
If the user wants to bypass it, he can change and uncomment a variable in the source, which can be opened in the system notepad by using a key (Ctrl-Alt-F or Shift-Alt-F, if the first one is already used, to be set manually in this case)

The path declaration and the explanations:

# In case of manual install, registry keys can't be found and menu is grayed
# To Bypass it, just fill the content of this variable the example value adapted
# to your config
# Example :
# $_Firefox_Path="\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" %1"
# You must restart K-Meleon to take the modifications
# You have two shortcuts to modify this value:
#  CTRL+ALT+F when The command line is empty
# SHIFT+ALT+F else

$_Firefox_Path="C:\\Program Files\\Firefox_7.0b5_English_Portable\\FirefoxPortable.exe %1";
# The value you ought to use

The function which allows the modification:
# ----- PRIVATE
_Firefox_CommandLine{
# try to get Firefox's command line from the Windows Registry
$__HKEY="HKCU";
$__data=readreg($__HKEY,"Software\\Mozilla\\Mozilla Firefox\\CurrentVersion");
$__data==""?$__HKEY="HKLM":0;
$__data==""?$__data=readreg($__HKEY,"Software\\Mozilla\\Mozilla Firefox\\CurrentVersion"):0;
$__data=readreg($__HKEY,"Software\\Mozilla\\Mozilla Firefox\\".$__data."\\Main\\PathToExe");
$__data==""?0:$__data=$__data." %1";
$_Firefox_CommandLine=$__data;
$_Firefox_Path==""?0:$_Firefox_CommandLine=$_Firefox_Path;
$_Firefox_CommandLine==""?setaccel("CTRL ALT F","macros(Firefox_Path)") : setaccel("SHIFT ALT F","macros(Firefox_Path)");
}

I haven't verified that the actual registry key is the same that the one I used, but it seems not to be the part which is wrong for you,

I Think you have missed the variable %1 in the string which, in fact is more then a path ...

I think it ought to work.

A+


Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:24.0) Gecko/20140105 Ubuntu/12.04 K-Meleon/74.0

Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr





Edited 2 time(s). Last edit at 01/07/2012 03:19PM by JujuLand.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: melo
Date: January 07, 2012 03:17PM

Quote
adodupan
melo, best scenario for you:

adodupan, thanks for wasting time for me !

This is what I have done and failed !

Unzip browser_km11.7z in C:\Program Files\K-Meleon\meloProfiles.
Change C:\Program Files\K-Meleon\profile.ini to what you said.
Start KM 1.1.6
In Tools, there is no Open in browser !

Thanks for your help but as already said too hard for me ! sad smiley

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: melo
Date: January 07, 2012 03:53PM

Quote
JujuLand
Here is the content of my version that I have written there is a long time.

YES ! It works... (Oui, ça marche...)

Merci, Jujuland, cela fonctionne maintenant parfaitement.
Comme tu le soulignes, j'avais du me mélanger les crayons en introduisant le chemin (je pense qu'il y avait au moins 1 " juste avant %1)...

Warning ! The problem was (\") : Jujuland example ...firefox.exe\" %1, right thing in Jujuland post above ...FirefoxPortable.exe %1

Command line was found in registry key :
[HKEY_CLASSES_ROOT\Applications\FirefoxPortable.exe\shell\open\command]

NB :
Jujuland/Alain proggy is very, very light, after tweaking to fit your configuration, it needs only firefox.kmm (3.6 KB) to work ! smiling smiley



Edited 6 time(s). Last edit at 01/07/2012 08:58PM by melo.

Options: ReplyQuote
Re: [Send Link To] : Add an item...
Posted by: JujuLand
Date: January 07, 2012 08:13PM

You're right in the sample, \" was missing after the name/path of firefox program.

KMEShelper.kmm is not needed to have Firefox.kmm to work.

It's just a macro which is made (or updated) by the setup to have info about installed KMES extensions, and to allow to uninstall it.

It's not recommanded to edit it, because it's structure is not too much obvious ...

A+


Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:24.0) Gecko/20140105 Ubuntu/12.04 K-Meleon/74.0

Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr





Edited 2 time(s). Last edit at 01/07/2012 08:14PM by JujuLand.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.