Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Duplicate This Tab
Envoyé par: Niceeight
Date: jeudi 7 décembre 2017 18:00:40

Hello! I'm a new fan of K-Meleon and I greet everyone.
Now i tried add the extension Duplicate this tab of Firefox (https://addons.mozilla.org/en-US/firefox/addon/duplicate-this-tab/) but not working.
My question is: can I use this extension? Or, best, i can create a macro with this function? I'd like to understand how to create macros for customize K-Meleon according to my needs.
I use K-meleon 76 PRO
Thans and regards!



Modifié 1 fois. Dernière modification le 07/12/17 18:01 par Niceeight.

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: siria
Date: jeudi 7 décembre 2017 18:36:45

Hi and welcome! Yes that definitely sounds like a little macro job, just opening URLs in tab or windows.
The FF addon page says it does:
1) duplicate tab
2) duplicate tab to new window
3) detach tab
4) merge windows

1) right-click on the Go-Button and click "Open in new page"
2) not yet
3) right-click on a tab and "Detach Tab", OR menu File (if hidden: Alt+F) then "Detach Tab"
4) not yet

New:
2) easy, if you need this can create a little macro using "opennew($URL)"
4) not quite as easy, but feasable - if it's important to you? A macro would have to collect all URLs in current window, then jump to the "next" window (but not chosable which one!), then open the URL-list again (loading from web again or cache, depending on your settings)



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: rodocop
Date: jeudi 7 décembre 2017 19:35:20

1) drag-n-drop your tab to the right empty space on tabbar - this duplicates the tab.



Modifié 1 fois. Dernière modification le 07/12/17 19:35 par rodocop.

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: Niceeight
Date: jeudi 7 décembre 2017 19:56:52

Thankyou rodocop for drag and drop trick.
First I not see "Open in new page" because I use the Default skin and go button there is not.
For duplicate tab to new window i'm not sure how to create a macro.
I create a new file with this name: duplicate.kmm and put it in macro folder.
I write in the file this:
Duplicate{
"opennew($URL)"
}

Nothing changed after the browser restart. I think I did not understand how to create the macro ...



Modifié 1 fois. Dernière modification le 07/12/17 19:59 par Niceeight.

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: siria
Date: jeudi 7 décembre 2017 21:31:59

=========== mini-version:

DuplicatePage_dupwin{
opennew($URL);
}

_DuplicatePage_BuildMenu{
setmenu("_Go_Open",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",1);
setmenu("New",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",2);
}

$OnInit=$OnInit."_DuplicatePage_BuildMenu;";
$macroModules=$macroModules."DuplicatePage;";


=========== long-version:

# UTF-8 K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/macrolanguage2)
# check syntax: menu Tools / Error Console -> KMM (chrome://console2/content/console2.xul)

# ------------------ DuplicatePage.kmm ------------------------------
# Version: 1 / 2017-12-07
# Menu: right-click on Tab / or on Go-Button / or in menu File
# Forum : http://kmeleonbrowser.org/forum/read.php?9,143575
# ----------------------------------------------------------------------------

DuplicatePage_duptab{
opentab($URL);
}

DuplicatePage_dupwin{
opennew($URL);
}

_DuplicatePage_BuildMenu{
# in submenu "New" of parent menu "TabButtonPopup" (created in menus.cfg)
setmenu("New",macro,"Duplicate Tab","DuplicatePage_duptab",2);
setmenu("New",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",3);
# Go-button context menu (created in main.kmm)
setmenu("_Go_Open",macro,"Duplicate Tab","DuplicatePage_duptab",1);
setmenu("_Go_Open",macro,"Duplicate Tab To New Window","DuplicatePage_dupwin",2);
}

$OnInit=$OnInit."_DuplicatePage_BuildMenu;";
$macroModules=$macroModules."DuplicatePage;";


=========== Go-button invisible?
If it's hidden, toggle the toolbar named "Go Buttons"
Or, to change single buttons, click Edit > Configuration > Toolbars (first make a backup copy of that file!)



Modifié 1 fois. Dernière modification le 07/12/17 21:40 par siria.

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: Niceeight
Date: vendredi 8 décembre 2017 17:52:44

Oh thanks. Fantastic! Now I'm starting understand how to use the macro. I modified the macro for my experience:

DuplicatePage_newtab{
opentab($URL);
}
DuplicatePage_newwin{
opennew($URL);
}
_DuplicatePage_BuildMenu{
setmenu("_Go_Open",macro,"Duplica scheda","DuplicatePage_newtab",1);
setmenu("New",macro,"Duplica Scheda","DuplicatePage_newtab",2);
setmenu("_Go_Open",macro,"Duplica Scheda in nuova finestra","DuplicatePage_newwin",1);
setmenu("New",macro,"Duplica Scheda in nuova finestra","DuplicatePage_newwin",2);
}

$OnInit=$OnInit."_DuplicatePage_BuildMenu;";
$macroModules=$macroModules."DuplicatePage;";

I'm Italian...
But if I would like have this function with right click anywhere on the page and not on the tab how can I do it?

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: siria
Date: vendredi 8 décembre 2017 18:22:59

Citation
Niceeight
if I would like have this function with right click anywhere on the page and not on the tab how can I do it?

That menu is called "DocumentPopup" (created in menus.cfg)
Or use one if its submenus, then it may show up in other menus as well.

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: Niceeight
Date: vendredi 8 décembre 2017 19:24:55

Ah ok. So I can create the macro for all menu in menu.cfg for exemple SelectedText, Toolbars or other...
Thankyou very much and if I need help again, likely, I ask again.
Hello!

Options: RépondreCiter
Re: Duplicate This Tab / [HOWTO] first macro
Envoyé par: siria
Date: vendredi 8 décembre 2017 19:51:12

Citation
Niceeight
Ah ok. So I can create the macro for all menu in menu.cfg for example SelectedText, Toolbars or other...

Exactly smiling smiley
And also the menus created by main.kmm in the macros folder.

If you want to modify a menu and know already its displayed name, for example "&File" or "&Edit" or "&View" or "Page &Properties", then you can use it directly, no need to look it up first. Just note that underlined characters in the name must be preceded with a "&"

You even can add a menu to "Main", that is the main menu bar.

In theory you can use all other macro created menus too, but the prob is, their order at startup matters. The menu-creating macro must be executed first, but that's just luck, the order is rather random. There are little tricks, but guess for now this is enough.
Have fun grinning smiley

Options: RépondreCiter
Re: Duplicate This Tab / [HOWTO] first macro
Envoyé par: Niceeight
Date: vendredi 8 décembre 2017 20:14:32

Yes yes, for now this is enough. Thankyou for your advice. I will make good use of it. For now create a macro for translate the page and the selected text without going through the submenus. For the order I use the number at the end of the line and it seems to be working...bah!
This is the macro "TranslateThis":

TranslateThisPage_newtab{
opentab("https://translate.google.com/translate?ie=UTF-8&act=url&u=".$URL);
}
TranslateThisLink_newtab{
#opentab("https://translate.google.com/?langpair=auto%7Cit&text=".$SelectedText);
opentab("https://translate.google.com/#auto/it/".$SelectedText);
}
_TranslateThisPage_BuildMenu{
setmenu("_Go_Open",macro,"Traduci Pagina","TranslateThisPage_newtab",2);
setmenu("New",macro,"Traduci Pagina","TranslateThisPage_newtab",3);
setmenu("DocumentPopup",macro,"Traduci Pagina","TranslateThisPage_newtab",1);
setmenu("DocumentPopup",macro,"Traduci Pagina","TranslateThisPage_newtab",2);
setmenu("SelectedText",macro,"Traduci Selezionato","TranslateThisLink_newtab",3);
setmenu("SelectedText",macro,"Traduci Selezionato","TranslateThisLink_newtab",4);
}
$OnInit=$OnInit."_TranslateThisPage_BuildMenu;";
$macroModules=$macroModules."TranslateThis;";


See You!

Options: RépondreCiter
Re: Duplicate This Tab / first macro
Envoyé par: siria
Date: vendredi 8 décembre 2017 21:08:44

Looks good so far, I see you're having fun grinning smiley
Only 2 menu lines are double...

Options: RépondreCiter
Re: Duplicate This Tab / first macro
Envoyé par: George_Hall
Date: vendredi 8 décembre 2017 21:46:11

There is also the Duplicate Tab macro http://kmext.sourceforge.net/extensions/dublicatetab.7z at K-Meleon Extensions Central http://kmext.sourceforge.net under Enhancements Extensions http://kmext.sourceforge.net/ext7.htm

It allow to duplcate a tab by right clicking on a single tab.

It was also mentioned previously by rodcop in the K-Meleon Forums

Re: TABS --- Macros for Groups of, Prior, and Last
http://kmeleonbrowser.org/forum/read.php?9,137101,137105#msg-137105

I even mentioned Duplicate Tab under a different Topic related to sessions

http://kmeleonbrowser.org/forum/read.php?4,133055,133138#msg-133138



Modifié 1 fois. Dernière modification le 08/12/17 21:53 par George_Hall.

Options: RépondreCiter
Re: Duplicate This Tab
Envoyé par: siria
Date: vendredi 8 décembre 2017 23:43:35

Thanks for the links George, not sure if he already noticed the handy kmext-archive smiling smiley

Just in this special case here, he wanted to duplicate it in a new WINDOW too, so did need a new macro anyway. So it was easier to just put both (tab+window) into the same macro, considering the basic function consists just of ultrasimple 1-liners (opentab()/opennew()), instead of juggling with 2 separate kmm-files.
And also because he's actually volunteering to learn macros, yay!! grinning smiley

Citation
Niceeight
Or, best, i can create a macro with this function? I'd like to understand how to create macros for customize K-Meleon according to my needs.


Options: RépondreCiter


K-Meleon forum is powered by Phorum.