Bugs :  K-Meleon Web Browser Forum
You can talk about issues with k-meleon here.  
CloneLayers.kmm and K-Meleon 1.5.2
Posted by: DannyD
Date: February 17, 2009 09:38PM

Hello everybody,

I am desperately seeking for a way to duplicate a tab (preferably with middle click) and came across CloneLayers.kmm http://kmeleon.sourceforge.net/wiki/KmmCloneLayers .
But no matter where I put the .kmm file and what I do, the makro doesn't do anything.
I'm using K-Meleon 1.5.2 (de). Makro execution is activated, of course.

Who can help me?

Or is there even a better way to have a tab duplicated with middle mouse-button click?

Cheers
DannyD

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: JamesD
Date: February 17, 2009 10:57PM

@ DannyD

I could not get MButton to work, but maybe this will help. If you right click on a tab, you get a dropdown menu. I have added two clone methods to that menu.

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- CloneTab.kmm
#
# Dependencies        : main.kmm
# Resources           : -  
# Preferences         : -
# Version             : 0.1  2/17/09   JamesD 
# --------------------------------------------------------------------------------

_CloneTab_Focus{
opentab( $URL );
	}

_CloneTab_BkGnd{
openbgtab( $URL ); 
	}	
	
_CloneTab_BuildMenu{
	# add another option to NavTab menu
	setmenu("NavTab",macro,"Clone Tab w/focus",_CloneTab_Focus,4);
	setmenu("NavTab",macro,"Clone Tab in bkgnd",_CloneTab_BkGnd,5);
	}
	
$OnInit=$OnInit."_CloneTab_BuildMenu;";
$macroModules=$macroModules."CloneTab;";


Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: guenter
Date: February 18, 2009 05:55AM

Ich gehe davon aus, Du willst es immer?

Mal nachsehen unter:
Bearbeiten > Einstellungen > Browsing Optionen > Beim Öffnen...

Extras > Maustastenkürzel > welcher Browser macht, was du gewohnt bist?


Preferences > Browsing Options to open "_blank" pages (this assumes that You constantly want it)

Tools > Mouse Gesture like, plus info/FAQ view the link to see default mouse settings of Your (ex) browser before K-Meleon.



Edited 1 time(s). Last edit at 02/18/2009 05:56AM by guenter.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: DannyD
Date: February 18, 2009 10:08AM

Thanks for the quick reply, JamesD!
"opentab($URL)" bound to the "NavTab" menu is doing exactly what I was looking before.

I too couldn't get MButton to work. Maybe Günther can shed some light on this.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: DannyD
Date: February 18, 2009 10:30AM

Quote
guenther
welcher Browser macht, was du gewohnt bist?

AFAIK no browser is behaving like this per default.
I am using FF with "Tab Mix Plus" add-on which allows me to configure "Mouse > Mouse clicks > Middle click > On a tab = Duplicate tab" (German FF: "Maus > Mausklicks > Mittelklick > Auf einen Tab > Tab duplizieren").

I've tried something like

%ifplugin tabs
MButton = ID_OPEN_FRAME_IN_BACKGROUNDTAB
%else
MButton = ID_OPEN_FRAME_IN_BACKGROUND
%endif

in accel.cfg but this wouldn't do anything.
Do you know a way to achieve what I want via accel.cfg instead of using a macro?

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: desga2
Date: February 18, 2009 11:47AM

CloneLayers.kmm macro is an old macro to 1.5 previus versions with layers (1.5 and later use real tabs).

Macros must be saved in "macros" subfolder in your K-Meleon profile;
Edit -> Configuration -> Profile Directory

JamesD did in above post a good adaptation to 1.5 and later versions for this macro.
Thanks JamesD, but i didn't it before because in 1.5 and later there are a better and easy way to clone tabs;

Drag & Drop the tab to clone in a tab bar free space.

But the macro is good because you could have a lot of tabs opened and there isn't no free space in tab bar. smiling smiley

You can use the above JamesD's macro and this line at the end to use middle click to clone current tab;
#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- CloneTab.kmm
#
# Dependencies        : main.kmm
# Resources           : -  
# Preferences         : -
# Version             : 0.1  2/17/09   JamesD 
# --------------------------------------------------------------------------------

_CloneTab_Focus{
opentab( $URL );
	}

_CloneTab_BkGnd{
openbgtab( $URL ); 
	}	
	
_CloneTab_BuildMenu{
	# add another option to NavTab menu
	setmenu("NavTab",macro,"Clone Tab w/focus",_CloneTab_Focus,4);
	setmenu("NavTab",macro,"Clone Tab in bkgnd",_CloneTab_BkGnd,5);
	# To use middle click to clone current tab:
	setaccel("MButton","macros(_CloneTab_BkGnd)");
	setaccel("CTRL MButton","macros(_CloneTab_Focus)");
	}
	
$OnInit=$OnInit."_CloneTab_BuildMenu;";
$macroModules=$macroModules."CloneTab;";

Also you can configure mouse behavior in tab bar in Preferences;
Right click over tab or tab bar and select Tabs -> Options... -> Tab Bar (tab) -> Mouse Control options.

K-Meleon in Spanish



Edited 4 time(s). Last edit at 02/18/2009 03:39PM by desga2.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: JamesD
Date: February 18, 2009 12:53PM

@ desga2

I tried the setaccel statement but whatever is set in preferences seemed to override. MButton continued to close the tab. That is why I did not include in macro.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: DannyD
Date: February 18, 2009 03:00PM

Quick responses and nice people (plus great software) - I like it here!

The code suggested by desga2 doesn't seem to do anything, at least on my installation. I second JamesD's observation.
This is what I am trying to do:

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- DuplicateTab.kmm ----------------------------------------------------
# Dependencies        : main.kmm
# Resources           : -
# Preferences         : -
# Version             : 0.1  2009-2-18   DannyD
# --------------------------------------------------------------------------------

_DuplicateTab_Focus{
	opentab( $URL );
}

_DuplicateTab_Init{
	setaccel("MButton","_DuplicateTab_Focus");
}

$OnInit=$OnInit."_DuplicateTab_Init;";
$macroModules=$macroModules."DuplicateTab;";

But the event triggered by MButton always comes from the preferences, setaccel("MButton") seems to be ignored.

Is this a bug in K-Meleon?

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: desga2
Date: February 18, 2009 03:37PM

This line in your code is wrong:
setaccel("MButton","_DuplicateTab_Focus");

must be;
setaccel("MButton","macros(_DuplicateTab_Focus)");

K-Meleon in Spanish

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: DannyD
Date: February 18, 2009 04:13PM

@ desga2: Thank you for the correction, but I'm afraid I still have to disappoint you - this is not working. As far as I can see, the setting "kmeleon.tabs.OnMiddleClick" always has got the precedence.
And that would be a bug, wouldn't it?

Attention, you might be fooled if you have "kmeleon.tabs.OnMiddleClick=1" and "kmeleon.display.newWindowOpenAs=2" configured. But instead of duplicating the tab which you have clicked on, it duplicates the current page.
Try middle-clicking on a tab in the background, you will see what I mean.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: JamesD
Date: February 18, 2009 04:53PM

Maybe I am having another senior moment, but I think you have to remove the underscore from the macro name to use it in setaccel.

setaccel("MButton","macros(_DuplicateTab_Focus)");
should be
setaccel("MButton","macros(DuplicateTab_Focus)");
and corresponding change in
DuplicateTab_Focus{

That's the way I tried it, but it still did not work.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: desga2
Date: February 19, 2009 04:25PM

Quote
JamesD
Maybe I am having another senior moment, but I think you have to remove the underscore from the macro name to use it in setaccel.

setaccel("MButton","macros(_DuplicateTab_Focus)");
should be
setaccel("MButton","macros(DuplicateTab_Focus)");
and corresponding change in
DuplicateTab_Focus{

That's the way I tried it, but it still did not work.

No, underscore isn't the problem.

1) Problem is Preferences setting override the macro accelerators settings.
Try to use other accelerator like "CTRL MButton" or "ALT MButton".

2) With a macro you can't clone tabs in background, only tab in foreground. (This needed toolbar plugin implementation to mouse behavior in tab bar and created a new macro function to know what tab was clicked)

3)
Quote
DannyD
Attention, you might be fooled if you have "kmeleon.tabs.OnMiddleClick=1" and "kmeleon.display.newWindowOpenAs=2" configured. But instead of duplicating the tab which you have clicked on, it duplicates the current page.
Try middle-clicking on a tab in the background, you will see what I mean.

This is his normal use (remember 2).
And this isn't a bug, is a feature or behavior not implemented yet.

Please, I said you above that you can use Drag&Drop tabs in free space of toolbar to clone it and this work also with tabs in background. (Drag&Drop is more easy that any accelerator)

K-Meleon in Spanish



Edited 1 time(s). Last edit at 02/19/2009 04:28PM by desga2.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: JamesD
Date: February 19, 2009 07:50PM

Quote
desga2
No, underscore isn't the problem.

1) Problem is Preferences setting override the macro accelerators settings.
Try to use other accelerator like "CTRL MButton" or "ALT MButton".

2) With a macro you can't clone tabs in background, only tab in foreground. (This needed toolbar plugin implementation to mouse behavior in tab bar and created a new macro function to know what tab was clicked)
You are right. I did not know that a private macro could be called with setaccel statement.

"CTRL or SHIFT" do not help. The tab just gets closed instead of cloned. The selection from Preferences is used.

From the NavTab menu, the macro will clone in background. Both new items in the menu work.

CloneTab.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- CloneTab.kmm
#
# Dependencies        : main.kmm
# Resources           : -  
# Preferences         : -
# Version             : 0.2  2/19/09   JamesD 
# --------------------------------------------------------------------------------

_CloneTab_Focus{
opentab( $URL );
	}

_CloneTab_BkGnd{
openbgtab( $URL ); 
	}	
	
_CloneTab_BuildMenu{
	# add another option to NavTab menu
	setmenu("NavTab",macro,"Clone Tab w/focus",_CloneTab_Focus,4);
	setmenu("NavTab",macro,"Clone Tab in bkgnd",_CloneTab_BkGnd,5);
	}
	
_CloneTab_SetAccels{
setaccel("SHIFT MButton", "macros(_CloneTab_Focus)");
setaccel("CTRL MButton", "macros(_CloneTab_BkGnd)");
	}
	
$OnInit=$OnInit."_CloneTab_BuildMenu;_CloneTab_SetAccels:";
$macroModules=$macroModules."CloneTab;";


Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: guenter
Date: February 19, 2009 08:37PM

"wow" - I do not have such a mouse but...


p.s. The idea and time invested to change macros to be modular carries many fruits.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: JamesD
Date: February 19, 2009 09:15PM

Oops I mistyped.

The next to last line in CloneTab.kmm is wrong. Replace the : with a ; and it works.

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: DannyD
Date: February 20, 2009 12:01PM

Hello, desga2!

Quote
desga2
2) With a macro you can't clone tabs in background, only tab in foreground. (This needed toolbar plugin implementation to mouse behavior in tab bar and created a new macro function to know what tab was clicked)
Hm, I observed otherwise: _CloneTab_BuildMenu{} as proposed by JamesD does work on tabs in the background.

Quote
desga2
3)
Quote
DannyD
Attention, you might be fooled if you have "kmeleon.tabs.OnMiddleClick=1" and "kmeleon.display.newWindowOpenAs=2" configured. But instead of duplicating the tab which you have clicked on, it duplicates the current page.
This is his normal use (remember 2).
And this isn't a bug, is a feature or behavior not implemented yet.
Sorry, what I meant was: Depending on your settings of "kmeleon.tabs.OnMiddleClick" and "kmeleon.display.newWindowOpenAs" it might appear as if the macro is working, while in fact it isn't.

Quote
desga2
Please, I said you above that you can use Drag&Drop tabs in free space of toolbar to clone it and this work also with tabs in background.
Yes, of course I can. It's just that I don't like Drag&Drop a lot, I like the middle-click which I'm used to. And I thought, "if there is one browser that I can twist as I want it, then it's this one..."

Quote
desga2
1) Problem is Preferences setting override the macro accelerators settings.
Not being too familiar with the design principles of K-Meleon I am still uncertain: Is this a bug or intended behaviour?

Options: ReplyQuote
Re: CloneLayers.kmm and K-Meleon 1.5.2
Posted by: desga2
Date: February 20, 2009 04:04PM

I think you could open a feature request.
In Bug tracker select "Report a Bug"
and in "Severity" select "RFE", explain your problem and put a link to this thread in forum for more info.

K-Meleon in Spanish

Options: ReplyQuote


K-Meleon forum is powered by Phorum.