Subject: 25.1; Results from eww DuckDuckGo searches cannot be loaded

From: [email-masked]
Date: Fri, 17 Mar 2017 20:50:14 +0000

Found in Emacs 25.1.1 but looks to be the same on master.  Using emacs
-Q, run M-x eww to do a search and then click on one of the search
results - the following error page will be displayed:

    'Oops, there was an error. Please try again.
    If it persists, please email [email-masked]'

This appears to be due to DDG trying to use a redirect to load the
result - this can be disabled (see https://duckduckgo.com/params for
details) by adding "kd=-1" to the query string in the URL in which case
the results can be loaded as expected.  Turning off redirects is less
secure, but as we're using HTTPS anyway this shouldn't be a problem (see
https://duckduckgo.com/privacy#s5).

Should be able to fix with:

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index c9f4e61..0066f54 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -49,7 +49,7 @@ eww-header-line-format
   :group 'eww
   :type 'string)

-(defcustom eww-search-prefix "https://duckduckgo.com/html/?q="
+(defcustom eww-search-prefix "https://duckduckgo.com/html/?kd=-1&q="
   "Prefix URL to search engine."
   :version "24.4"
   :group 'eww

Cheers!