Commit 456696a8 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen
Browse files

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
parent fd42a192
......@@ -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))
(insert "<title>Unsupported content type</title>")
(insert (format "<h1>Content-type %s is unsupported</h1>"
(car content-type)))
(insert (format "<a href=%S>Direct link to the document</a>"
(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")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment