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