eww.texi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. \input texinfo @c -*-texinfo-*-
  2. @c %**start of header
  3. @setfilename ../../info/eww.info
  4. @settitle Emacs Web Wowser
  5. @include docstyle.texi
  6. @c %**end of header
  7. @copying
  8. This file documents the GNU Emacs Web Wowser (EWW) package.
  9. Copyright @copyright{} 2014--2016 Free Software Foundation, Inc.
  10. @quotation
  11. Permission is granted to copy, distribute and/or modify this document
  12. under the terms of the GNU Free Documentation License, Version 1.3 or
  13. any later version published by the Free Software Foundation; with no
  14. Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
  15. and with the Back-Cover Texts as in (a) below. A copy of the license
  16. is included in the section entitled ``GNU Free Documentation License.''
  17. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  18. modify this GNU manual.''
  19. @end quotation
  20. @end copying
  21. @dircategory Emacs misc features
  22. @direntry
  23. * EWW: (eww). Emacs Web Wowser
  24. @end direntry
  25. @finalout
  26. @titlepage
  27. @title Emacs Web Wowser (EWW)
  28. @subtitle A web browser for GNU Emacs.
  29. @page
  30. @vskip 0pt plus 1filll
  31. @insertcopying
  32. @end titlepage
  33. @contents
  34. @ifnottex
  35. @node Top
  36. @top EWW
  37. @insertcopying
  38. @end ifnottex
  39. @menu
  40. * Overview::
  41. * Basics::
  42. * Advanced::
  43. Appendices
  44. * History and Acknowledgments::
  45. * GNU Free Documentation License:: The license for this documentation.
  46. Indices
  47. * Key Index::
  48. * Variable Index::
  49. * Lisp Function Index::
  50. * Concept Index::
  51. @end menu
  52. @node Overview
  53. @chapter Overview
  54. @dfn{EWW}, the Emacs Web Wowser, is a web browser for GNU Emacs. It
  55. can load, parse, and display various web pages using @dfn{shr.el}.
  56. However a GNU Emacs with @code{libxml2} support is required.
  57. @node Basics
  58. @chapter Basic Usage
  59. @findex eww
  60. @findex eww-open-file
  61. @vindex eww-search-prefix
  62. @cindex eww
  63. @cindex Web Browsing
  64. You can open a URL or search the web with the command @kbd{M-x eww}.
  65. If the input doesn't look like a URL or domain name the web will be
  66. searched via @code{eww-search-prefix}. The default search engine is
  67. @url{https://duckduckgo.com, DuckDuckGo}. If you want to open a file
  68. either prefix the file name with @code{file://} or use the command
  69. @kbd{M-x eww-open-file}.
  70. @findex eww-quit
  71. @findex eww-reload
  72. @findex eww-copy-page-url
  73. @kindex q
  74. @kindex w
  75. @kindex g
  76. If loading the URL was successful the buffer @file{*eww*} is opened
  77. and the web page is rendered in it. You can leave EWW by pressing
  78. @kbd{q} or exit the browser by calling @kbd{eww-quit}. To reload the
  79. web page hit @kbd{g} (@code{eww-reload}). Pressing @kbd{w}
  80. (@code{eww-copy-page-url}) will copy the current URL to the kill ring.
  81. @findex eww-readable
  82. @kindex R
  83. The @kbd{R} command (@code{eww-readable}) will attempt to determine
  84. which part of the document contains the ``readable'' text, and will
  85. only display this part. This usually gets rid of menus and the like.
  86. @findex eww-toggle-fonts
  87. @findex shr-use-fonts
  88. @kindex F
  89. The @kbd{F} command (@code{eww-toggle-fonts}) toggles whether to use
  90. variable-pitch fonts or not. This sets the @code{shr-use-fonts} variable.
  91. @findex eww-toggle-colors
  92. @findex shr-use-colors
  93. @kindex F
  94. The @kbd{C} command (@code{eww-toggle-colors}) toggles whether to use
  95. HTML-specified colors or not. This sets the @code{shr-use-colors} variable.
  96. @findex eww-download
  97. @vindex eww-download-directory
  98. @kindex d
  99. @cindex Download
  100. A URL under the point can be downloaded with @kbd{d}
  101. (@code{eww-download}). The file will be written to the directory
  102. specified in @code{eww-download-directory} (Default: @file{~/Downloads/}).
  103. @findex eww-back-url
  104. @findex eww-forward-url
  105. @findex eww-list-histories
  106. @kindex r
  107. @kindex l
  108. @kindex H
  109. @cindex History
  110. EWW remembers the URLs you have visited to allow you to go back and
  111. forth between them. By pressing @kbd{l} (@code{eww-back-url}) you go
  112. to the previous URL@. You can go forward again with @kbd{r}
  113. (@code{eww-forward-url}). If you want an overview of your browsing
  114. history press @kbd{H} (@code{eww-list-histories}) to open the history
  115. buffer @file{*eww history*}. The history is lost when EWW is quit.
  116. If you want to remember websites you can use bookmarks.
  117. @vindex eww-history-limit
  118. Along with the URLs visited, EWW also remembers both the rendered
  119. page (as it appears in the buffer) and its source. This can take a
  120. considerable amount of memory, so EWW discards the history entries to
  121. keep their number within a set limit, as specified by
  122. @code{eww-history-limit}; the default being 50. This variable could
  123. also be set to @code{nil} to allow for the history list to grow
  124. indefinitely.
  125. @cindex PDF
  126. PDFs are viewed inline, by default, with @code{doc-view-mode}, but
  127. this can be customized by using the mailcap (@pxref{mailcap,,,
  128. emacs-mime, Emacs MIME Manual})
  129. mechanism, in particular @code{mailcap-mime-data}.
  130. @findex eww-add-bookmark
  131. @findex eww-list-bookmarks
  132. @kindex b
  133. @kindex B
  134. @cindex Bookmarks
  135. EWW allows you to @dfn{bookmark} URLs. Simply hit @kbd{b}
  136. (@code{eww-add-bookmark}) to store a bookmark for the current website.
  137. You can view stored bookmarks with @kbd{B}
  138. (@code{eww-list-bookmarks}). This will open the bookmark buffer
  139. @file{*eww bookmarks*}.
  140. @findex eww-switch-to-buffer
  141. @findex eww-list-buffers
  142. @kindex s
  143. @kindex S
  144. @cindex Multiple Buffers
  145. To get summary of currently opened EWW buffers, press @kbd{S}
  146. (@code{eww-list-buffers}). The @file{*eww buffers*} buffer allows you
  147. to quickly kill, flip through and switch to specific EWW buffer. To
  148. switch EWW buffers through a minibuffer prompt, press @kbd{s}
  149. (@code{eww-switch-to-buffer}).
  150. @findex eww-browse-with-external-browser
  151. @vindex shr-external-browser
  152. @vindex eww-use-external-browser-for-content-type
  153. @kindex &
  154. @cindex External Browser
  155. Although EWW and shr.el do their best to render webpages in GNU
  156. Emacs some websites use features which can not be properly represented
  157. or are not implemented (E.g., JavaScript). If you have trouble
  158. viewing a website with EWW then hit @kbd{&}
  159. (@code{eww-browse-with-external-browser}) inside the EWW buffer to
  160. open the website in the external browser specified by
  161. @code{shr-external-browser}. Some content types, such as video or
  162. audio content, do not make sense to display in GNU Emacs at all. You
  163. can tell EWW to open specific content automatically in an external
  164. browser by customizing
  165. @code{eww-use-external-browser-for-content-type}.
  166. @node Advanced
  167. @chapter Advanced
  168. @findex eww-view-source
  169. @kindex v
  170. @cindex Viewing Source
  171. You can view the source of a website with @kbd{v}
  172. (@code{eww-view-source}). This will open a new buffer
  173. @file{*eww-source*} and insert the source. The buffer will be set to
  174. @code{html-mode} if available.
  175. @findex url-cookie-list
  176. @kindex C
  177. @cindex Cookies
  178. EWW handles cookies through the @ref{Top, url package, ,url}.
  179. You can list existing cookies with @kbd{C} (@code{url-cookie-list}).
  180. For details about the Cookie handling @xref{Cookies,,,url}.
  181. @vindex eww-header-line-format
  182. @cindex Header
  183. The header line of the EWW buffer can be changed by customizing
  184. @code{eww-header-line-format}. The format replaces @code{%t} with the
  185. title of the website and @code{%u} with the URL.
  186. @findex eww-toggle-paragraph-direction
  187. @cindex paragraph direction
  188. The @kbd{D} command (@code{eww-toggle-paragraph-direction}) toggles
  189. the paragraphs direction between left-to-right and right-to-left
  190. text. This can be useful on web pages that display right-to-left test
  191. (like Arabic and Hebrew), but where the web pages don't explicitly
  192. state the directionality.
  193. @c @vindex shr-bullet
  194. @c @vindex shr-hr-line
  195. @c @vindex eww-form-checkbox-selected-symbol
  196. @c @vindex eww-form-checkbox-symbol
  197. @c EWW and the rendering engine shr.el use ASCII characters to
  198. @c represent some graphical elements, such as bullet points
  199. @c (@code{shr-bullet}), check boxes
  200. @c (@code{eww-form-checkbox-selected-symbol} and
  201. @c @code{eww-form-checkbox-symbol}), and horizontal rules
  202. @c @code{shr-hr-line}). Depending on your fonts these characters can be
  203. @c replaced by Unicode glyphs to achieve better looking results.
  204. @vindex shr-max-image-proportion
  205. @vindex shr-blocked-images
  206. @cindex Image Display
  207. Loading random images from the web can be problematic due to their
  208. size or content. By customizing @code{shr-max-image-proportion} you
  209. can set the maximal image proportion in relation to the window they
  210. are displayed in. E.g., 0.7 means an image is allowed to take up 70%
  211. of the width and height. If Emacs supports image scaling (ImageMagick
  212. support required) then larger images are scaled down. You can block
  213. specific images completely by customizing @code{shr-blocked-images}.
  214. @vindex shr-color-visible-distance-min
  215. @vindex shr-color-visible-luminance-min
  216. @cindex Contrast
  217. EWW (or rather its HTML renderer @code{shr}) uses the colors declared
  218. in the HTML page, but adjusts them if needed to keep a certain minimum
  219. contrast. If that is still too low for you, you can customize the
  220. variables @code{shr-color-visible-distance-min} and
  221. @code{shr-color-visible-luminance-min} to get a better contrast.
  222. @cindex Desktop Support
  223. @cindex Saving Sessions
  224. In addition to maintaining the history at run-time, EWW will also
  225. save the partial state of its buffers (the URIs and the titles of the
  226. pages visited) in the desktop file if one is used. @xref{Saving Emacs
  227. Sessions, , emacs, The GNU Emacs Manual}.
  228. @vindex eww-desktop-remove-duplicates
  229. EWW history may sensibly contain multiple entries for the same page
  230. URI@. At run-time, these entries may still have different associated
  231. point positions or the actual Web page contents.
  232. The latter, however, tend to be overly large to preserve in the
  233. desktop file, so they get omitted, thus rendering the respective
  234. entries entirely equivalent. By default, such duplicate entries are
  235. not saved. Setting @code{eww-desktop-remove-duplicates} to nil will
  236. force EWW to save them anyway.
  237. @vindex eww-restore-desktop
  238. Restoring EWW buffers' contents may prove to take too long to
  239. finish. When the @code{eww-restore-desktop} variable is set to
  240. @code{nil} (the default), EWW will not try to reload the last visited
  241. Web page when the buffer is restored from the desktop file, thus
  242. allowing for faster Emacs start-up times. When set to @code{t},
  243. restoring the buffers will also initiate the reloading of such pages.
  244. @vindex eww-restore-reload-prompt
  245. The EWW buffer restored from the desktop file but not yet reloaded
  246. will contain a prompt, as specified by the
  247. @code{eww-restore-reload-prompt} variable. The value of this variable
  248. will be passed through @code{substitute-command-keys} upon each use,
  249. thus allowing for the use of the usual substitutions, such as
  250. @code{\[eww-reload]} for the current key binding of the
  251. @code{eww-reload} command.
  252. @node History and Acknowledgments
  253. @appendix History and Acknowledgments
  254. EWW was originally written by Lars Ingebrigtsen, known for his work on
  255. Gnus. He started writing an Emacs HTML rendering library,
  256. @code{shr.el}, to read blogs in Gnus. He eventually added a web
  257. browser front end and HTML form support. Which resulted in EWW, the
  258. Emacs Web Wowser. EWW was announced on 16 June 2013:
  259. @url{http://lars.ingebrigtsen.no/2013/06/16/eww/}.
  260. EWW was then moved from the Gnus repository to GNU Emacs and several
  261. developers started contributing to it as well.
  262. @node GNU Free Documentation License
  263. @chapter GNU Free Documentation License
  264. @include doclicense.texi
  265. @node Key Index
  266. @unnumbered Key Index
  267. @printindex ky
  268. @node Variable Index
  269. @unnumbered Variable Index
  270. @vindex eww-after-render-hook
  271. After eww has rendered the data in the buffer,
  272. @code{eww-after-render-hook} is called. It can be used to alter the
  273. contents, for instance.
  274. @printindex vr
  275. @node Lisp Function Index
  276. @unnumbered Function Index
  277. @printindex fn
  278. @node Concept Index
  279. @unnumbered Concept Index
  280. @printindex cp
  281. @bye