A setting to enable search words in a region when the region is specified or a word at the point when the region is not specified. Results are displayed in EWW-mode which enables to do everything inside Emacs.
(setq eww-search-prefix "https://www.google.co.jp/search?btnI&q=")
;;
(defun my-eww-search--words (words)
"search web search engine for word on cursor."
(let ((search_words (read-from-minibuffer "EWW search for: " words)))
(split-window-sensibly)
(eww search_words)))
;;
(defun my-eww-search-words ()
"Search the region when transient-mark-mode is on, a word at point otherwise."
(interactive)
(cond
((region-active-p)
(and transient-mark-mode mark-active)
(my-eww-search--words (buffer-substring-no-properties (mark) (point))))
(t
(my-eww-search--words (thing-at-point 'word t)))))
(global-set-key "\C-cg" 'my-eww-search-words)