Lister: use selection as a URL
Moderators: Hacker, petermad, Stefan2, white
Lister: use selection as a URL
There is already a nice option to search for a selected text in Google.
A natural addition would be to go directly to the address in selection.
The selection does not need to be parsed for http:// and the like, because quite often URL might be given as www.site.com or even site.org, but a browser still could open that page.
A natural addition would be to go directly to the address in selection.
The selection does not need to be parsed for http:// and the like, because quite often URL might be given as www.site.com or even site.org, but a browser still could open that page.
Last edited by browny on 2024-10-12, 11:59 UTC, edited 1 time in total.
Already possible.
Just add similar text to your main INI file under [Lister] section.
You can also define many browsers, e.g.
Just add similar text to your main INI file under [Lister] section.
Code: Select all
Contextmenu1=Open in default browser|http://%s
Code: Select all
ContextMenu2=Open in Opera|"C:\Program Files\Opera\Opera.exe" %s
ContextMenu3=Open in Firefox|"C:\Program Files\Mozilla Firefox\firefox.exe" %s
ContextMenu4=Open in Internet Explorer|"C:\Program Files\Internet Explorer\IEXPLORE.EXE" %s
Code: Select all
Contextmenu2=Open in default browser|%s
Thanks, Gral.
Re: Lister: use selection as an URL
Thanks.21.08.24 Added: Lister: Right click on URL starting with http://, https://, www. or alphanumeric text with at least one dot before the end selects it and shows context menu item 'Open in default browser' (32/64)
This implementationI could be enhanced, so that the menu item 'Open in default browser' would also be present for a selection: use selection if there is no link at the cursor, or the cursor is at the selection (a link or a part of the link was selected explicitly).
Selected text should not be parsed - this would help if text was not recognized as a URL.
An additional possibility, seletion could be a file path/name to be opened in a browser.
The most common operation with selections is 'Copy', so ''Open in default browser' item should be always at the bottom to prevent the item from jumping around the menu.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Lister: use selection as a URL
It already is when you select an URL manually.This implementationI could be enhanced, so that the menu item 'Open in default browser' would also be present for a selection
Why not? You would only get an error otherwise.Selected text should not be parsed
Please report any such cases.this would help if text was not recognized as a URL
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Lister: use selection as a URL
It is not if selection was not "a URL" by your definition.ghisler(Author) wrote: 2024-10-13, 07:37 UTCIt already is when you select an URL manually.This implementationI could be enhanced, so that the menu item 'Open in default browser' would also be present for a selection
Besides, there are other URL schemes, not only hypertext.
No big deal.ghisler(Author) wrote: 2024-10-13, 07:37 UTCWhy not? You would only get an error otherwise.Selected text should not be parsed
For example, a program needs a file name in command line, but got a directory path - simply correct your actions and choose a file.
Same here, user should think at least when selecting text.
As said above, file names can be without dots and usually cannot contain URL schemes.ghisler(Author) wrote: 2024-10-13, 07:37 UTCPlease report any such cases.this would help if text was not recognized as a URL
Also examples would be: localhost for local site, of a line "thisserver 10.0.0.10" in hosts file, or DNS suffix in network configuration.
It all boils down to the initial feature request - use selection, otherwise trying to parse text for a link would be a nice addition.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Lister: use selection as a URL
You could define your own custom menu item, e.g.
Contextmenu2=Open in Chrome|"chrome.exe" %s
Contextmenu2=Open in Chrome|"chrome.exe" %s
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Lister: use selection as a URL
So I did 7 years ago - following Gral's advice; and still keep it for 11.50.
Re: Lister: use selection as a URL
TC does not validate URL syntax or link destination, so user's decisions may take precedence over automatic ones.
Otherwise, the action would still be done with slightly more efforts, be it a custom menu or mere copy & paste.
Otherwise, the action would still be done with slightly more efforts, be it a custom menu or mere copy & paste.