;; 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
(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)
(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 the Chrome browser."
+ :type 'string
+ :version "25.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 "25.1"
+ :group 'browse-url)
+
(defcustom browse-url-chromium-program
(let ((candidates '("chromium" "chromium-browser")))
(while (and candidates (not (executable-find (car candidates))))
;;; ((executable-find browse-url-netscape-program) 'browse-url-netscape)
;;; ((executable-find browse-url-mosaic-program) 'browse-url-mosaic)
((executable-find browse-url-conkeror-program) 'browse-url-conkeror)
+ ((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
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.