1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-27 19:31:38 +00:00

browse-url.el: Add 'google-chrome' to supported browsers.

This commit is contained in:
Kelvin White 2016-01-24 14:37:38 -05:00 committed by l3thal
parent 3772f44422
commit 05a630484f
2 changed files with 38 additions and 0 deletions

View File

@ -1120,6 +1120,9 @@ make the new option `eshell-destroy-buffer-when-process-dies' non-nil.
** Browse-url
---
*** Support for the Google Chrome web browser.
---
*** Support for the Conkeror web browser.

View File

@ -36,6 +36,7 @@
;; Function Browser Earliest version
;; browse-url-mozilla Mozilla Don't know
;; browse-url-firefox Firefox Don't know (tried with 1.0.1)
;; browse-url-chrome Chrome 47.0.2526.111
;; browse-url-chromium Chromium 3.0
;; browse-url-epiphany Epiphany Don't know
;; browse-url-conkeror Conkeror Don't know
@ -147,6 +148,7 @@ regexp should probably be \".\" to specify a default browser."
(function-item :tag "eww" :value eww-browse-url)
(function-item :tag "Mozilla" :value browse-url-mozilla)
(function-item :tag "Firefox" :value browse-url-firefox)
(function-item :tag "Google Chrome" :value browse-url-chrome)
(function-item :tag "Chromium" :value browse-url-chromium)
(function-item :tag "Epiphany" :value browse-url-epiphany)
(function-item :tag "Conkeror" :value browse-url-conkeror)
@ -259,6 +261,22 @@ Defaults to the value of `browse-url-firefox-arguments' at the time
(make-obsolete-variable 'browse-url-firefox-startup-arguments
"it no longer has any effect." "24.5")
(defcustom browse-url-chrome-program
(let ((candidates '("google-chrome-stable" "google-chrome")))
(while (and candidates (not (executable-find (car candidates))))
(setq candidates (cdr candidates)))
(or (car candidates) "chromium"))
"The name by which to invoke Chromium."
:type 'string
:version "24.1"
:group 'browse-url)
(defcustom browse-url-chrome-arguments nil
"A list of strings to pass to Google Chrome as arguments."
:type '(repeat (string :tag "Argument"))
:version "24.1"
:group 'browse-url)
(defcustom browse-url-chromium-program
(let ((candidates '("chromium" "chromium-browser")))
(while (and candidates (not (executable-find (car candidates))))
@ -902,6 +920,7 @@ instead of `browse-url-new-window-flag'."
((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-chrome-program) 'browse-url-chrome)
((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)
@ -1126,6 +1145,22 @@ The optional argument NEW-WINDOW is not used."
browse-url-chromium-arguments
(list url)))))
(defun browse-url-chrome (url &optional _new-window)
"Ask the Google Chrome WWW browser to load URL.
Default to the URL around or before point. The strings in
variable `browse-url-chrome-arguments' are also passed to
Google Chrome.
The optional argument NEW-WINDOW is not used."
(interactive (browse-url-interactive-arg "URL: "))
(setq url (browse-url-encode-url url))
(let* ((process-environment (browse-url-process-environment)))
(apply 'start-process
(concat "google-chrome " url) nil
browse-url-chrome-program
(append
browse-url-chrome-arguments
(list url)))))
;;;###autoload
(defun browse-url-galeon (url &optional new-window)
"Ask the Galeon WWW browser to load URL.