Function: browse-url-default-browser

browse-url-default-browser is a byte-compiled function defined in browse-url.el.gz.

Signature

(browse-url-default-browser URL &rest ARGS)

Documentation

Find a suitable browser and ask it to load URL.

Default to the URL around or before point.

When called interactively, if variable browse-url-new-window-flag is non-nil, load the document in a new window, if possible, otherwise use a random existing one. A non-nil interactive prefix argument reverses the effect of browse-url-new-window-flag.

When called non-interactively, optional second argument ARGS is used instead of browse-url-new-window-flag.

Source Code

;; Defined in /usr/src/emacs/lisp/net/browse-url.el.gz
(defun browse-url-default-browser (url &rest args)
  "Find a suitable browser and ask it to load URL.
Default to the URL around or before point.

When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new window, if possible, otherwise use
a random existing one.  A non-nil interactive prefix argument reverses
the effect of `browse-url-new-window-flag'.

When called non-interactively, optional second argument ARGS is used
instead of `browse-url-new-window-flag'."
  (apply
   (cond
    ((memq system-type '(windows-nt ms-dos cygwin))
     'browse-url-default-windows-browser)
    ((memq system-type '(darwin))
     'browse-url-default-macosx-browser)
    ((browse-url-can-use-xdg-open) 'browse-url-xdg-open)
;;;    ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
    ((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
    ((executable-find browse-url-firefox-program) 'browse-url-firefox)
    ((executable-find browse-url-chromium-program) 'browse-url-chromium)
;;;    ((executable-find browse-url-galeon-program) 'browse-url-galeon)
    ((executable-find browse-url-kde-program) 'browse-url-kde)
;;;    ((executable-find browse-url-netscape-program) 'browse-url-netscape)
    ((executable-find browse-url-chrome-program) 'browse-url-chrome)
    ((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
    ((locate-library "w3") 'browse-url-w3)
    (t
     (lambda (&rest _ignore) (error "No usable browser found"))))
   url args))