General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: Voltaire
Date: December 18, 2016 11:46AM

It's a nice feature to right-click an url written on a page and directly open it in a new tab ... But this does not work if the url is multiple-lined with LineBreak inside ... Example here: https://www.heise.de/forum/Telepolis/Kommentare/Gefaehrden-die-Glocken-schnell-laufender-Kampfkuehe-die-Sicherheit-der-Schweiz/Re-Sprengladungen-an-Rheinbruecken-und-auf-Autobahnen/posting-25163327/show/

You then have to either copy the url line per line into the url-field, or copy the entire url (including LineBreak signs) into an editor, remove the LineBreaks and then recopy it into the url-field ...

Please make the funktionality to just ignore eventual LineBreak inside urls to right-click-open.

Btw.: please also fix it in KM75.0/75.1 (not only in the latest 76 revision)



Edited 1 time(s). Last edit at 12/18/2016 12:03PM by Voltaire.

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: JamesD
Date: December 18, 2016 12:29PM

The link you included in the post opens for me OK. I tried in a new tab with KM 76 and I tried in a new background tab using KM 75.1

Is the link that you included one which has the problem?

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: Mikk
Date: December 18, 2016 06:07PM

Perheaps KM settings? Some option inserting hard CR-LF instead of soft-CR and on this way it breaks the link? (No idea which one, a hint for somebody knowing KM inside better as me, eventually).
Quote
Voltaire
.../Gefaehrden-die-Glocken-schnell-laufender-Kampfkuehe-die-Sicherheit-der-Schweiz/
ROFL - typical Switzerlandgrinning smileygrinning smiley (Do the bells of fast running wrestling cows endanger the security of Switzerland :cool smiley



Edited 2 time(s). Last edit at 12/18/2016 06:51PM by Mikk.

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: JamesD
Date: December 18, 2016 07:24PM

Quote
Voltaire
It's a nice feature to right-click an url written on a page and directly open it in a new tab ... But this does not work if the url is multiple-lined with LineBreak inside ... Example here: https://www.heise.de/forum/Telepolis/Kommentare/Gefaehrden-die-Glocken-schnell-laufender-Kampfkuehe-die-Sicherheit-der-Schweiz/Re-Sprengladungen-an-Rheinbruecken-und-auf-Autobahnen/posting-25163327/show/

I copied the above to Notepad++ and the only line break that I found was the one at the end of "show/".

Can you post a link to a site with a link that has line breaks within a link on the site?

Well, I just now looked closer at this site. It is what I was just preparing to ask of you. Once on the site, I see this:

http://www.bzbasel.ch/aargau/fricktal/schweizer-militaer-entfernt-let
zten-sprengstoff-aus-deutscher-holzbruecke-128571359

The above does not let one right click on it and get the "link" selection of actions. As far as KM is concerned it is not a link. Note that it is not shown in a link color. Voltaire is right that this won't work.

I will see if there is something that I can do in a macro to make the removal of [cr][lf] happen. May take me a while.

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 18, 2016 08:07PM

Ah, thanks James for finding this. Now finally having a working (=not working ;-) ) example, and looking in my right-menu what happens, it gave me a warning message that this is not a link! Never saw such a message (am usually opening links by middle-click), but it looked exactly like something I would do in my macros... Bingo! A text search in macros folder brought up the creating macro - written by me in spring for Voltaire, LOL! grinning smiley Had completely forgotten about it.

The rest is peanuts, just inserted 1 more line to automatically remove all linebreaks in a selection and then open it, instead of complaining.
Hope it works - haven't tested yet... :cool: (would have to close my current session first)

http://kmeleonbrowser.org/forum/read.php?1,138321,140476#msg-140476

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 18, 2016 08:26PM

What's confusing me now though:
My usual method would be to select the text, then hit the Go-Button.
And - this works too! Just not sure why :cool: Out-of-box function or customized too?

Does this work for everyone?

www.bzbasel.ch/aargau/fricktal/schweizer-militaer-entfernt-let
zten-sprengstoff-aus-deutscher-holzbruecke-128571359


PS: I mean, does this work despite a LINEBREAK in the selected text for everyone? The Select-and-Go method of course has always been included in KM since forever. But had no idea that "Open" commands automatically ignore all linebreaks too!



Edited 1 time(s). Last edit at 12/18/2016 09:01PM by siria.

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: JamesD
Date: December 18, 2016 08:44PM

This is just a test, but it seems to work. Siria, have not had time to try your code yet. I looked everywhere for the linebreak error message and did not find it. I think it is built into the commandID.

droplbrun.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
#  
# ---------- droplbrun.kmm    "Drop linebreak & run" K-Meleon Macro Language   ---------------
# ---------- Allow user to select text which might me a LINK but has a line break
#
# Dependencies        : - main.kmm 
# Reference           : -  
# Version             : - 1.0   2016_12_18  JamesD
# --------------------------------------------------------------------------------

_droplbrun_oper1 {
macroinfo = "Run the droplbrun test." ;
$_droplbrun_CurrClip = getclipboard();
id(ID_EDIT_COPY);
$_droplbrun_Working_text = getclipboard();
setclipboard($_droplbrun_CurrClip);
$_droplbrun_New_link = gsub( "\n", "", $_droplbrun_Working_text ); 
opentab( $_droplbrun_New_link );   
}

_droplbrun_BuildMenu {
setmenu("SelectedText",macro,"droplbrun TEST","_droplbrun_oper1",-1);
}
# - - - - - - - - - - - - - - - - - - - - - - 
$OnInit=$OnInit."_droplbrun_BuildMenu;";
$macroModules=$macroModules."droplbrun;";


Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: Voltaire
Date: December 18, 2016 10:04PM

@siria: Great ... yes, it was that 5x-macro ... but it's working now ... grinning smiley grinning smiley grinning smiley grinning smiley grinning smiley
(I had that macro only in 75.1-installed, not in 75.0-portable; the latter was not affected)

... and sorry for the confusion which url was meant ... winking smiley

Btw: as I too often use a Notebook (that does have neither middle-button, nor screoll-wheel) I usually select the url and right-click one of the 5 possibilities; I mostly use open in new tab in foreground and open in new tab in background (and keep staying on former tab). When selecting the url-text and hitting go-button (triangle facing rightwards), nothing happens at all ...



Edited 4 time(s). Last edit at 12/18/2016 10:29PM by Voltaire.

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 18, 2016 10:30PM

Thanks for reporting, glad it works smiling smiley

But very strange that the Go-Button does nothing for you...
Perhaps broken by some customizing, another macro or whatever tweak? (Can't be this macro here or the button wouldn't work for me neither)
Or perhaps no setting at all yet, although can't imagine.
Or hm, which KM version is this, could it be a new bug, anyone else have that prob?

The setting how to open such text-links is found here:
F2 > Browsing > Open > Selected Text: click a box of your choice

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 18, 2016 10:40PM

Quote
Voltaire
Btw: as I too often use a Notebook (that does have neither middle-button, nor scroll-wheel) I usually select the url and right-click one of the 5 possibilities; I mostly use open in new tab in foreground and open in new tab in background

Yes I mostly open links in new tabs too, prefer them in background.
For such "most used" cases it may be quicker to hold CTRL or Shift down while clicking the link or the Go-Button, depending on settings.
One of the best gems of KM smiling smiley

http://kmeleonbrowser.org/wiki/FAQ#mouseaccels

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: Voltaire
Date: December 18, 2016 11:04PM

smiling smiley grinning smiley

Must be some weird already installed additional stuff that makes the go button not work ... Btw.: I have installed on that PC (it's a notebook) several versions; only with 75.1-installed go-button is not working; 75.0-portable is working fine, and 75.1-portable also ... the 5x-macro is also only used at 75.1-installed-version ...

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 18, 2016 11:13PM

I have doubts it's that macro because both do work for me.
But to be sure, you can simply disable that macro for a test (either in settings or by moving the file outside the macros folder, then restart).

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 18, 2016 11:30PM

No, it's really not possible that 5x is the culprit. Just a short look at the code shows there's definitely no button command of any sort inside, and neither does it modify any native commands. It uses an own, new command name. The only replacement it does is 1 line in the right-click menu, but clicking the button has nothing to do with that, it calls directly the native action.

Could be another macro...

Or it could also be a customized or very obsolete skin, calling another command by that button?
Check in Edit>Config.>Toolbars
The "Go" button should have this line:
macros(Go_Selected)|_Go

Or some change in accels.cfg...

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: Voltaire
Date: December 19, 2016 01:12AM

No, that 5x-macro is not the culprit, but some edits in the toolbar. I have set some differences in toolbars: I have a toolbar for all "switches"; all with green tick-mark/red wrong-sense-of-driving-and-entrance-not-allowed icon, containing: colors, images, animation, javascript, js-page, cookies, popups, java, referer, user-agent, proxy. A separate toolbar is the "Clear-Bar", containing: clear-cache, clear-cookies, clear-history, clear-passwords, clear-url-bar, clear-all. A third toolbar is the "Kill Bar", containing: kill-flash and kill-applets. Obviously I must have done some wrong edits so that configuration is not a submenu in edit-menu or in config-gear-wheel.



Edited 3 time(s). Last edit at 12/19/2016 08:48AM by Voltaire.

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 20, 2016 01:24AM

You mean you can't find the toolbar config?
That would just be a prob in menus, but if so that's due to the default setting in newer KM-versions, which have the menu bar hidden initially, not anything you may have changed in toolbar config. Menus and toolbars are configured in different places. And yes, the new default settings are missing a few important commands.

But the toolbar config can also be found manually via system file explorer, the file is called "toolbars.cfg" :cool: Then open in Notepad or similar. The bigger prob is to identify the active cfg file if there exist several ones for different skins or in different profiles etc.

So the better alternative is to switch on the traditional menu bar again to unhide those vanished menu parts. Just temporarily. This will definitely open the active file. Right-click on an empty spot in the toolbars, it hopefully shows now the list all available toolbars, visible or hidden ones. The menu bar should be one of them... or was that called "main bar"?? Anyway, just see and try :cool:

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: Voltaire
Date: December 20, 2016 11:52AM

No, no ... I just did some manual changes in toolbar.cfg file that obviously change more than expected ... and also diable other parts (config as menu etc.)

As told: I want to have:
3 separate bars instead of only one with all the stuff:
- "switch bar" (with green-tick/red-minus for each entry)
- "clear bar" (with all the clear options)
- "kill bar" (with the kill options; only Flash & Applets)
because I want to be able to turn on or off these bars separately by right-click into empty part of menu ...

There seems to be some strange structure details in toolbar.cfg where the different parts begin and end, so there might have been some confusion what to turn on or off (setting # in front of line to turn off) that turned into the errors and false-behaviour.

Options: ReplyQuote
Re: Select url and direct right-click-open not possible when linebreak in link sad smiley
Posted by: siria
Date: December 20, 2016 12:28PM

Quote
Voltaire
No, no ... I just did some manual changes in toolbar.cfg file that obviously change more than expected ... and also diable other parts (config as menu etc.)

No, that's what I've been trying to explain above:
Manual changes in toolbars.cfg simply _cannot_ affect the menu structure.
Menu structure is done in menus.cfg

Of course, both buttons and menus can be changed by macros too, but you're blaming your own edits in toolbars.cfg, and that's just not possible to be the reason.

As for "beginnings and ends", perhaps you know already, but an editor with folding feature is great, like Notepad++. It can collapse all inside two matching beginning-and-end brackets, making probs easier to find.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.