Skip to content

Commit

Permalink
Ticket #4615: web.sh - select browser at runtime
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Yury V. Zaytsev <[email protected]>
  • Loading branch information
Andreas Mohr authored and zyv committed Dec 16, 2024
1 parent 511d4d8 commit f8f220d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ if $HAVE_FILECMD; then
fi
fi

dnl Only list browsers here that can be run in background (i.e. with `&')
AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])


dnl ############################################################################
dnl Check for other tools
Expand Down
9 changes: 7 additions & 2 deletions misc/ext.d/web.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ do_open_action() {

case "${filetype}" in
html)
(if [ -n "@X11_WWW@" -a -n "$DISPLAY" ]; then
(@X11_WWW@ file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" &) 1>&2
(if [ -n "$DISPLAY" ]; then
for browser in gnome-moz-remote mozilla firefox chromium google-chrome konqueror brave-browser opera open ; do
if which "${browser}" 1>&2 ; then
"${browser}" file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" 1>&2 &
break
fi
done
else
elinks "${MC_EXT_FILENAME}" || \
links "${MC_EXT_FILENAME}" || \
Expand Down

0 comments on commit f8f220d

Please sign in to comment.