General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: Voltaire
Date: January 04, 2016 11:52AM

For many ways to open a new url it's possible that they are opened in a new tab (enter an url by keyboard and press enter, click on any bookmark/favorite, etc.). But how to modify "go to url" button (the green triangle facing right) so that a simple click does not open the url in the same tab, but in a new tab??? It must be by one single click; options with right-tab are something else and can still remain additional! Btw: in the options (right-click on button) there is only "open in a new window" ... And please be aware: non touching of the keyboard is mandatory! It has to be done by mouse only; and it has to be done by one single click (and nothing like "first open a new blank window, then enter url-text into url-line, then ... etc.)!

Btw: some kind of setting (to do with right-click) that you can chose between | >open in same tab | >open in new tab | >open in new window | would be nice ... (you swicht the mode by right-click, and then a single click does what was chosen)



Edited 2 time(s). Last edit at 01/04/2016 11:56AM by Voltaire.

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: siria
Date: January 04, 2016 01:13PM

There are tons of context situations, am not quite sure which one you mean exactly... And which KM version are you using?

Just hit F2 and you're right there at the default settings:
for "Typed URLs" choose "new tab" as mode. Done.
That works for several open-actions too, like selected text etc.

And on the Go-button right-click has always been the command "open in new page", not "new window", except perhaps in prehistoric times when tabs didn't exist yet ;-) The "new page" does open either a tab or window, depending from your global setting above.

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: siria
Date: January 04, 2016 01:37PM

Tip:
If you want a link to "Preferences" in the GO context menu, without hitting F2 on the keyboard, use menu Edit > Configuration > Menus.
That opens menus.cfg in your current profile folder.
Or to edit the default menus for ALL profiles open menus.cfg in the defaults folder.

At the end add this:

!_Go_Open{
Pr&eferences...=ID_PREFERENCES
}


Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: Voltaire
Date: January 04, 2016 04:33PM

Quote
siria
There are tons of context situations, am not quite sure which one you mean exactly... And which KM version are you using?

As described: the green "go to url"-Button (that are these two triangles, the left facing right, the right facing up). These two are a separate toolbar called "Go Buttons" and look like this in toolbars.cfg

&Go Buttons{

Go{
%ifplugin macros
macros(Go_Selected)|_Go
Go to URL. Right-click for more options.
%else
navGo
%endif
}

%ifplugin macros
Up{
macros(Go_Up)|_Up
Go up one directory level. Right-click for more options.
}
%endif

}

Just add "_Open" at "Go{" opens a new tab; but that tab remains empty even with a valid url in the clipboard ...

As said before: it must be with one single click (an no right-click ... blabla ... selection ... etc.)


Quote
siria
Just hit F2 and you're right there at the default settings:
for "Typed URLs" choose "new tab" as mode. Done.
That works for several open-actions too, like selected text etc.

Sorry, but you're wrong: I already set ALL of them to "open in a new tab", but the above mentioned "go to url" button is not affected! If you click that button, the selected text is treated as url and opened IN THE SAME TAB! And that's the problem here: I want it to open IN A NEW TAB ... as I do not want to touch the keyboard, but do ALL with the mouse (incl. copying of the url-text)!

The behaviour should be, that a click onto that green "go to url"-button should open just a new tab with the same open url (and go to it). It's quite often that I am on a page and want to open some links, but the links do not open in a new tab, but only work if directly clicked on it. Then I have to duplicate the open page as I want to keep it and not go back, as when going back, many things can be lost.

Quote
siria
And on the Go-button right-click has always been the command "open in new page", not "new window", except perhaps in prehistoric times when tabs didn't exist yet ;-) The "new page" does open either a tab or window, depending from your global setting above.

As stated above: when "open in a new tab/window" does not work (as parameters are not transmitted), it's necessary to directly click on the link. But it's not possible to keep that page and in the same time to leftclick on a link on that page ...

Btw: KM-Version is always the last official one (not beta etc.)



Edited 3 time(s). Last edit at 01/04/2016 04:41PM by Voltaire.

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: siria
Date: January 04, 2016 04:54PM

So, trying to get a grip at this confusion...
You mean, when you right-click on a LINK, you cannot open it in a new page, because it's probably not a real link but a javascript or onclick-action?
And you want the "duplicate this page" action on LEFT-click on the Go-Button (I do understand which button you mean, that's about the only thing fully clear ;-))

This may require a little custom macro, probably easy...

The global settings to open "Typed URLs" and "Selected Text" in a new tab do work normal, with the only exception, if the called adress is the same as the one that is already open, the page only gets reloaded in the same tab. But that's about the only occasion I think...

Or am I lost in the woods now again?? :cool:

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: siria
Date: January 04, 2016 05:19PM

Actually it's far easier than first thought:
Open KM/macros/main.kmm in some text editor (after making a backup copy, named "main_ori_kmm"), and around line 677 you find this macro:

Go_Selected{
macroinfo=_("Open the selected text as URL or open URL Bar contents");
$OpenURL=$SelectedText; $OpenURL==""?0:&OpenURL_Selected; $OpenURL=$OpenURL==""?$URLBAR:"";
$OpenURL==""?0sad smiley$OpenURL==$URL?id(ID_NAV_RELOAD):&OpenURL_Typed);
}

Change the last line from:
$OpenURL==""?0:($OpenURL==$URL?id(ID_NAV_RELOAD):&OpenURL_Typed);
to:
$OpenURL==""?0:&OpenURL_Typed;

That will just remove the exception for "reload SAME URL here".
The other settings still depend from your global configuration in F2.



Edited 1 time(s). Last edit at 01/04/2016 05:23PM by siria.

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: Voltaire
Date: January 05, 2016 12:43AM

That does not work; it does not have the effect of opening a new tab!

Btw: just discovered that the task to "duplicate the current tab" is solved with an other button: with "open new tab" (that one with the green plus-sign between last/next and close). So that task can be considered done ...

But there is anothter task to do: "open a new (copied url) in a new tab (only by mouse).

Following procedure:
- select any url or go directly over an url-link
- copy it (with right-click "copy")
- paste it into the url-line
- click on the corresponding button (one single click!) so that that the (selected and pasted) url opens in a new tab.

As before: touching the keyboard is not allowed; so pressing "enter" on the keyboard (what is working now) is no valid solution!

And there should not happen anything already at that moment when the url is copied to the clipboard ... So the tab should not open at that moment the url is copied to the clipboard!

Pressing the "go to url"-button seems to be the most obvious solution here, but that does not work ... as the url is opened in the same tab ...

The idea is to add a "open in a new tab" to that "go to url"-button ...

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: Voltaire
Date: January 05, 2016 01:00AM

OK, the "second task" (open copied and pasted url in new tab) is working already (with out any configuration change), but only with right-click: after pasting the url into the url-line, right-click on "go-to-url"-button and select "open in new page" (in german: "öffnen in neuer Seite").

Now the task seems easyer: I want to map that "right-click and select first menu-item" to a button that can be left-clicked (leaving open if it's the same button or a new one) ... As a "left-click" just opens the current tab it would make sense to map it to that "go-to-url"-button.

Now the thing is the parameter that is taken for opening the new tab: as it is now, it's the current open page (wher is that url taken from?) and not the url that was pasted into the url-line. The aim would be that a left-click onto that "go-to-url"-button would "read" what was pasted into the url-line and open the new tab with that url (and not with the url from the current open window).

Btw: I would not exclude that something like that (or parts of it) are already implemented and I just did not yet discover it ...
Bt



Edited 1 time(s). Last edit at 01/05/2016 01:01AM by Voltaire.

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: Voltaire
Date: January 05, 2016 01:04AM

Hmm ... after trying several things (without change of any macro- or toolbar-file) it's doing exactly what I want ... was it that I just had to do it with right-click (on first "go-to-url"-popup-item") that left-click just does exactly that? I really wonder ...

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: rodocop
Date: January 05, 2016 01:15AM

Why not to use 'Paste&Go' option or my 'Paste@Go-hack'?

Options: ReplyQuote
Re: How to modify "Go to url"-Button so that it always opens a new tab?
Posted by: siria
Date: January 05, 2016 01:35AM

Or if the copied text is from the same page, then no paste of any sort is necessary anyway. Just select the text and hit go - and it always opens in a new tab for me. Same for select+SearchButton. Just a matter of the settings in F2.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.