I have emacs 25.1.1 on Ubuntu 16.04 and have been trying to browse with its built in eww browser.

I start with M-x eww.

Then I type in my search keyword. DuckDuckgo displays a list of search results as expected. However if I navigate (using C-n, C-p, C-f, and C-b) to a link and try to follow it (return) DuckDuckgo fails, displaying:

'Oops, there was an error. Please try again.

If it persists, please email ops@duckduckgo.com'

Any ideas as to how to diagnose this problem? Essentially I cannot browse with eww, although firefox and google-chrome work fine (whether I use DuckDuckgo or google search).


I think the problem occurs because DDG is doing a JavaScript redirect to the selected link. You can disable this by adding "kd=-1" into the URL query string. This doesn't help specifically with running eww (although I'm sure it's easy enough to fix) but you can work around it by using a custom function to kick off a DDG search:

(defun duckduckgo (search-string)
  "Search Duck Duck Go for SEARCH-STRING.

Use kd=-1 to turn off redirecting - seems to be required in order
for result links to work in DDG."
  (interactive "sDuckDuckGo for: ")
  (let ((url-format "https://duckduckgo.com/html/?q=%s&kd=-1"))
    (eww (format url-format (url-hexify-string search-string)))))

Edit - in fact it looks as if you ought to be able to just set eww-search-prefix to something like "https://duckduckgo.com/html/?kd=-1&q=".


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.