Ticket #4615: mc-4615-select-browser-at-runtime.patch

File mc-4615-select-browser-at-runtime.patch, 1.7 KB (added by and, 11 days ago)
  • configure.ac

    From a93e522c7202d9b25aefb8f8d8364a1dce678df3 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 15 Dec 2024 22:00:00 +0000
    Subject: [PATCH] (web.sh) select browser at runtime
    
    Current browser selection happen on compile time and should change to runtime selection.
    
    - add chromium browser to list
    - bonus: remove shellcheck warning
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     configure.ac         | 3 ---
     misc/ext.d/web.sh.in | 9 +++++++--
     2 files changed, 7 insertions(+), 5 deletions(-)
    
    diff --git a/configure.ac b/configure.ac
    index a3761a4ee..237c9a982 100644
    a b if $HAVE_FILECMD; then 
    213213    fi 
    214214fi 
    215215 
    216 dnl Only list browsers here that can be run in background (i.e. with `&') 
    217 AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera]) 
    218  
    219216 
    220217dnl ############################################################################ 
    221218dnl Check for other tools 
  • misc/ext.d/web.sh.in

    diff --git a/misc/ext.d/web.sh.in b/misc/ext.d/web.sh.in
    index 17d7e6354..c86fc7d21 100644
    a b do_open_action() { 
    2828 
    2929    case "${filetype}" in 
    3030    html) 
    31         (if [ -n "@X11_WWW@" -a  -n "$DISPLAY" ]; then 
    32             (@X11_WWW@ file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" &) 1>&2 
     31        (if [ -n "$DISPLAY" ]; then 
     32            for browser in gnome-moz-remote mozilla firefox konqueror opera chromium ; do 
     33                if which "${browser}" 1>&2 ; then 
     34                    "${browser}" file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" 1>&2 & 
     35                    break 
     36                fi 
     37            done 
    3338        else 
    3439            elinks "${MC_EXT_FILENAME}" || \ 
    3540                links "${MC_EXT_FILENAME}" || \