From: Lars Ingebrigtsen Date: Tue, 24 Jan 2017 22:39:05 +0000 (+0100) Subject: Avoid having eww unexpectedly open external browsers X-Git-Tag: emacs-26.0.90~870^2~73 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=456696a838dfef73364ca025a210d2198fd8390d;p=emacs.git Avoid having eww unexpectedly open external browsers * lisp/net/eww.el (eww-render): Instead of opening unsupported content types like audio/mpeg directly in an external browser (which can be very confusing especially when something redirects to a file like that), just display a simple interstitial that people can choose to click on or not (bug#22671). --- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 3e5d4467eac..172044a12ec 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -364,7 +364,14 @@ Currently this means either text/html or application/xhtml+xml." ((and eww-use-external-browser-for-content-type (string-match-p eww-use-external-browser-for-content-type (car content-type))) - (eww-browse-with-external-browser url)) + (erase-buffer) + (insert "Unsupported content type") + (insert (format "

Content-type %s is unsupported

" + (car content-type))) + (insert (format "Direct link to the document" + url)) + (goto-char (point-min)) + (eww-display-html charset url nil point buffer encode)) ((eww-html-p (car content-type)) (eww-display-html charset url nil point buffer encode)) ((equal (car content-type) "application/pdf")