• Opening a URL with NetSurf from another application

    From Stefan Monnier@21:1/5 to All on Tue Nov 5 05:10:01 2024
    Someone mentioned NetSurf recently here and I'm trying it out.
    It's an interesting "halfway" point between TUI browsers like Lynx/EWW,
    and monsters like Firefox.

    But I'd like to be able to send URLs to NetSurf and can't figure out how
    to do it. Am I missing something? Say you'd like to install it as your default browser: how would you get it to open a new tab in an existing
    window when, e.g. `xdg-open` needs it?


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan Dowland@21:1/5 to Stefan Monnier on Tue Nov 5 13:00:01 2024
    On Tue Nov 5, 2024 at 4:08 AM GMT, Stefan Monnier wrote:
    Someone mentioned NetSurf recently here and I'm trying it out.
    It's an interesting "halfway" point between TUI browsers like Lynx/EWW,
    and monsters like Firefox.

    But I'd like to be able to send URLs to NetSurf and can't figure out how
    to do it. Am I missing something? Say you'd like to install it as your default browser: how would you get it to open a new tab in an existing
    window when, e.g. `xdg-open` needs it?

    There isn't a single consistent way of specifying a default browser
    across Debian. But, you mention `xdg-open`, and most applications use
    the XDG MIME scheme.

    To configure that, take a look at the xdg-mime(1) manpage, and related
    docs. Some hints (values from my own machine):

    $ xdg-mime query default x-scheme-handler/http
    userapp-Firefox-8JP4U1.desktop
    $ xdg-mime query default text/html
    firefox.desktop
    # doesn't match! let's fix it
    $ xdg-mime default userapp-Firefox-8JP4U1.desktop text/html
    $ xdg-mime query default text/html
    userapp-Firefox-8JP4U1.desktop

    You probably want to set a bunch of different and related MIME types to
    a default browser. Check ~/.config/mimeapps.list to build a list. You
    specify the application in terms of a .desktop file; I see netsurf-gtk
    provides one.

    Some other apps use the much older mailcap system (mutt I think is one);
    See /etc/mailcap, update-mime(8), run-mailcap(1) (which is also the man
    page for edit, view, see, compose and print)




    --
    Please do not CC me for listmail.

    👱🏻 Jonathan Dowland
    [email protected]
    🔗 https://jmtd.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to All on Tue Nov 5 17:30:02 2024
    Max Nikulin [2024-11-05 23:04:16] wrote:
    On 05/11/2024 11:08, Stefan Monnier wrote:
    But I'd like to be able to send URLs to NetSurf and can't figure out how
    to do it. Am I missing something? Say you'd like to install it as your
    default browser: how would you get it to open a new tab in an existing
    window when, e.g. `xdg-open` needs it?

    <https://wiki.debian.org/DefaultWebBrowser#GUI_Applications>

    That's the part with which I'm familiar. My question is about NetSurf.

    and proper CLI options

    That's my question.


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to All on Tue Nov 5 20:40:02 2024
    On 05/11/2024 11:08, Stefan Monnier wrote:
    default browser: how would you get it to open a new tab in an existing >>>> window when, e.g. `xdg-open` needs it?

    Max Nikulin [2024-11-05 23:51:21] wrote:
    Is your problem that new window is opened instead of new tab in response to "xdg-open https://debian.org"?

    Yup.

    Looking into the man page, I am in doubts if
    the command may communicate with an earlier launched instance.

    That's also my conclusion from reading the doc, but the doc seems
    sufficiently minimalist that I'm hoping the feature is there, just not documented properly.


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)