diff options
| author | Lars Ingebrigtsen | 2017-01-24 23:39:05 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2017-01-24 23:39:05 +0100 |
| commit | 456696a838dfef73364ca025a210d2198fd8390d (patch) | |
| tree | d6e89deb98240739e60484b5ff428d2fdf1dc339 | |
| parent | fd42a19260841a2e3c39fd983c7601a3f517bf4b (diff) | |
| download | emacs-456696a838dfef73364ca025a210d2198fd8390d.tar.gz emacs-456696a838dfef73364ca025a210d2198fd8390d.zip | |
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).
| -rw-r--r-- | lisp/net/eww.el | 9 |
1 files changed, 8 insertions, 1 deletions
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." | |||
| 364 | ((and eww-use-external-browser-for-content-type | 364 | ((and eww-use-external-browser-for-content-type |
| 365 | (string-match-p eww-use-external-browser-for-content-type | 365 | (string-match-p eww-use-external-browser-for-content-type |
| 366 | (car content-type))) | 366 | (car content-type))) |
| 367 | (eww-browse-with-external-browser url)) | 367 | (erase-buffer) |
| 368 | (insert "<title>Unsupported content type</title>") | ||
| 369 | (insert (format "<h1>Content-type %s is unsupported</h1>" | ||
| 370 | (car content-type))) | ||
| 371 | (insert (format "<a href=%S>Direct link to the document</a>" | ||
| 372 | url)) | ||
| 373 | (goto-char (point-min)) | ||
| 374 | (eww-display-html charset url nil point buffer encode)) | ||
| 368 | ((eww-html-p (car content-type)) | 375 | ((eww-html-p (car content-type)) |
| 369 | (eww-display-html charset url nil point buffer encode)) | 376 | (eww-display-html charset url nil point buffer encode)) |
| 370 | ((equal (car content-type) "application/pdf") | 377 | ((equal (car content-type) "application/pdf") |