Launch URL with Any Browser

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
TestMeister
Posts: 191
Joined: 04 Feb 2008 20:17

Launch URL with Any Browser

Post by TestMeister »

  • Chrome is my default browser so when I save a URL to a file folder, it creates a Chrome shortcut
  • I frequently am working among multiple web sites and to keep things organized, use multiple browsers.
  • I often save URLs in a file folder associated with the project I am working on
  • I would like to be able to open a URL with Chrome, Edge or Firefox
The "Send to" doesn't work as it tries to send the entire shortcut to the browser which is what Windows File Explorer does.
Is there a way to format a URL, perhaps in a text file, so XY will process it?[/list]

Alternatively, can the "Open With" "Custom File Associations" be configured to show multiple browsers?

highend
Posts: 13433
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Launch URL with Any Browser

Post by highend »

Create a script that reads the url file (it's nothing more than an .ini) and then uses popupmenu() to show a list of your browsers to open the url and put that in your CFA list. The same would work for the "Open With" part of the CFA list...
One of my scripts helped you out? Please donate via Paypal

TestMeister
Posts: 191
Joined: 04 Feb 2008 20:17

Re: Launch URL with Any Browser

Post by TestMeister »

Thanks for the tip but my skill at scripts is very weak.
However, it looks like the XY Custom File Associations almost does it as the browsers are now listed in the "Open with" dialogue.
It works for Firefox, but oddly, defining Chrome and Edge the same way, it sends the shortcut not the URL.
However, all three are properly parsed with the Windows File Explorer
Attachments
ScreenHunter 50.png
ScreenHunter 50.png (61 KiB) Viewed 1585 times
ScreenHunter 51.png
ScreenHunter 51.png (30.15 KiB) Viewed 1585 times
ScreenHunter 52.png
ScreenHunter 52.png (48.78 KiB) Viewed 1585 times
ScreenHunter 53.png
ScreenHunter 53.png (24.97 KiB) Viewed 1585 times

highend
Posts: 13433
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Launch URL with Any Browser

Post by highend »

Code: Select all

    $url = getkey("URL", "InternetShortcut", <curitem>);
    end (!$url), "No URL found in:" . <crlf 2> . quote(<curitem>);

    $browsers = <<<>>>
Vivaldi|D:\Tools\Vivaldi_x64\Vivaldi [Portable].exe|D:\Tools\Vivaldi_x64\Vivaldi [Portable].exe
Opera|D:\Tools\Opera\Opera [Portable].exe|D:\Tools\Opera\Opera [Portable].exe
    >>>;

    $browser = popupmenu($browsers, 6:=<crlf>, 7:="|");
    if ($browser) {
        run lax("$browser" $url);
    }
One of my scripts helped you out? Please donate via Paypal

TestMeister
Posts: 191
Joined: 04 Feb 2008 20:17

Re: Launch URL with Any Browser

Post by TestMeister »

Thanks, very kind of you!

I expect this won't work from a toolbar button, where do I define this?

highend
Posts: 13433
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Launch URL with Any Browser

Post by highend »

It works everywhere (button, catalog, ...).

Use it as a CFA^^

"Open url file" url>::load "Launch url with any browser.xys";
One of my scripts helped you out? Please donate via Paypal

TestMeister
Posts: 191
Joined: 04 Feb 2008 20:17

Re: Launch URL with Any Browser

Post by TestMeister »

So in XY, navigate to the file, select it and hit the button, right?

highend
Posts: 13433
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Launch URL with Any Browser

Post by highend »

Just double click it?
One of my scripts helped you out? Please donate via Paypal

TestMeister
Posts: 191
Joined: 04 Feb 2008 20:17

Re: Launch URL with Any Browser

Post by TestMeister »

Is there any way to have it appear in the mouse context menu the way the Open with works??

highend
Posts: 13433
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Launch URL with Any Browser

Post by highend »

|"Open url file" url>::load "Launch url with any browser.xys";
One of my scripts helped you out? Please donate via Paypal

Post Reply