# Elinks configuration file. # # Only options which are different from elinks' default are set. To make this # work config.saving_style is set to 3 (see below). # # WARNING: Elinks is not safe to use with Tor because it leaks DNS requests # (it's also not recommended because an attacker can detect elinkse # because they act differently than Firefox - HTTP headers, etc.)! # # There are two ways to fix the DNS problem. The simple solution is # to use `torsocks`. But that won't work if you want to use an # intermediate proxy which doesn't speak SOCKS. In this case you have # to patch the source. The following hacky patch "fixes" the problem # (by always resolving "localhost"). # # --- a/src/network/dns.c # +++ b/src/network/dns.c # @@ -138,9 +138,10 @@ del_dns_cache_entry(struct dnsentry *dnsentry) # /* Synchronous DNS lookup management: */ # # enum dns_result # -do_real_lookup(unsigned char *name, struct sockaddr_storage **addrs, int *addrno, # +do_real_lookup(unsigned char *oldname, struct sockaddr_storage **addrs, int *addrno, # int in_thread) # { # + unsigned char *name = "localhost"; # #ifdef CONFIG_IPV6 # struct addrinfo hint, *ai, *ai_cur; # #else # @@ -148,6 +149,8 @@ do_real_lookup(unsigned char *name, struct sockaddr_storage **addrs, int *addrno # #endif # int i; # # + (void)oldname; # + # if (!name || !addrs || !addrno) # return DNS_ERROR; # BOOKMARK OPTIONS # CONFIGURATION HANDLING OPTIONS # When saving the configuration write only changed settings in the current # elinks session to this file (missing options are added to the end). set config.saving_style = 3 # Internal setting necessary to detect old values for config.saving_style. set config.saving_style_w = 1 # CONNECTION OPTIONS # Don't retry establishing a connection if it failed. Tor does this on its # own. set connection.retries = 1 # Increase receive timeout to ten minutes (Tor takes that long sometimes). set connection.receive_timeout = 600 # COOKIE OPTIONS # Don't accept any cookies. set cookies.accept_policy = 0 # Limit expiration date to one day. set cookies.max_age = 1 # Don't save any cookies to disk (if they are accepted during a session). set cookies.save = 0 # DOCUMENT BROWSING OPTIONS # Ignore meta refresh tag. set document.browse.refresh = 0 # Display links to images without an alt attribute (or an empty alt, i.e. # alt=""); otherwise they aren't displayed at all. set document.browse.images.show_as_links = 1 # Display the alt/title attribute of an image or the filename if alt/title # doesn't exist. set document.browse.images.display_style = 3 # Limit the filename to 32 characters. set document.browse.images.filename_maxlen = 32 # Always display image link symbols ([ and ]). set document.browse.images.image_link_tagging = 2 # Display number of the link next to it so it can be easily accessed by just # entering the corresponding number. set document.browse.links.numbering = 1 # Don't respect the tabindex element as it causes link numbering (see above) # to not work properly. As I use the link number tabindex is not useful # anyway. set document.browse.links.use_tabindex = 0 # Open links with target="_blank" in the current tab. I want to decide where # to open a link. set document.browse.links.target_blank = 0 # Use basic regexes while searching. set document.browse.search.regex = 1 # Ask if login passwords should be saved. set document.browse.forms.show_formhist = 1 # DEFAULT DOCUMENT COLOR SETTINGS # Use the color settings of the loaded page (except background color) and from # CSS files. My custom CSS file (see below) overrides all settings so only my # colors are used. set document.colors.use_document_colors = 1 # CASCADING STYLE SHEET OPTIONS # Enable usage of CSS. Necessary to use my custom CSS settings. set document.css.enable = 1 # Don't fetch any external CSS files. set document.css.import = 0 # Use my custom CSS file. set document.css.stylesheet = "user.css" # FILE HANDLING AND DOWNLOAD OPTIONS # Don't ask when using handlers defined by mailcap. So images are opened # without a dialog. set mime.mailcap.ask = 0 # Save downloads into my home directory. set document.download.directory = "~/" # Use timestamp stored on the server for downloaded files. set document.download.set_original_time = 1 # Play an audio notification if a download is completed if it was in the # background. set document.download.notify_bell = 1 # PLAIN TEXT PAGE OPTIONS # Display URIs as links in plain text documents so they can accessed easily. set document.plain.display_links = 1 # PROTOCOL SPECIFIC OPTIONS # My proxy settings. set protocol.http.proxy.host = "127.0.0.1:8118" set protocol.https.proxy.host = "127.0.0.1:8118" set protocol.ftp.proxy.host = "127.0.0.1:8118" # Don't use a proxy for local pages. set protocol.no_proxy = "127.0.0.1, localhost" # Send the requested page as referrer to prevent privacy problems. set protocol.http.referer.policy = 1 # Don't send Accept-Language headers as this may reveal parts of my identity. set protocol.http.accept_ui_language = 0 # URI REWRITE RULES # Remove default rewriting rules. include(elinks/rewrite-reset.conf) # Search engines scroogle and metager2. set protocol.rewrite.smart.s = "https://ssl.scroogle.org/cgi-bin/nbbwssl.cgi?Gw=%s" set protocol.rewrite.smart.sm = "http://www.metager2.de/search.php?q=%s" # Search pages on web.archive.org. set protocol.rewrite.smart.a = "http://web.archive.org/web/*/%s" # Search English and German Wikipedia. set protocol.rewrite.smart.w = "https://secure.wikimedia.org/wikipedia/en/wiki/%s" set protocol.rewrite.smart.wd = "https://secure.wikimedia.org/wikipedia/de/wiki/%s" # SSL Logins for Wikipedia. set protocol.rewrite.dumb.wl = "https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special:UserLogin" set protocol.rewrite.dumb.wdl = "https://secure.wikimedia.org/wikipedia/de/w/index.php?title=Spezial:Anmelden" # Search English-German translations with dict.leo.org. set protocol.rewrite.smart.d = "http://dict.leo.org/ende?search=%s" # Search for scripts, etc. on vim.org. set protocol.rewrite.dumb.vs = "http://www.vim.org/search.php" # Search for debian packages. set protocol.rewrite.smart.dp = "http://packages.debian.org/%s" # Local shortcuts. set protocol.rewrite.smart.l = "http://localhost/~simon/%s" set protocol.rewrite.smart.ld = "http://localhost/~simon/doc/%s" set protocol.rewrite.smart.lu = "http://localhost/~simon/use/%s" set protocol.rewrite.smart.lt = "http://localhost/~simon/util/%s" # Privoxy. set protocol.rewrite.dumb.p = "http://p.p/" # Lua manual. set protocol.rewrite.dumb.ldl = "file:///opt/local/share/doc/lua50/html/manual.html" # TERMINAL OPTIONS # Settings for screen. Use colors, transparency, underlines and UTF-8. set terminal.screen.colors = 1 set terminal.screen.transparency = 1 set terminal.screen.underline = 1 set terminal.screen.utf_8_io = 1 # Settings for screen with 256 colors, same as for screen above (except more # colors). set terminal.screen-256color.colors = 3 set terminal.screen-256color.transparency = 1 set terminal.screen-256color.underline = 1 set terminal.screen-256color.utf_8_io = 1 # USER INTERFACE OPTIONS # Use the system language. This settings is necessary as elinks wants it to be # in elinks.conf (or it adds it with every configuration save). set ui.language = "System" # Don't display success boxes when saving something, i.e. the configuration # file. set ui.success_msgbox = 0 # SESSION OPTIONS # Save session as bookmark when quitting. set ui.sessions.auto_save = 1 # Restore this session on startup. set ui.sessions.auto_restore = 1 # Take snapshots to allow restore after a crash. set ui.sessions.snapshot = 1 # KEY BINDINGS # Move bindings like in Vim: hjkl. bind "main" "h" = "scroll-left" bind "main" "j" = "scroll-down" bind "main" "k" = "scroll-up" bind "main" "l" = "scroll-right" # Allow easy moving to next link. Not really like in Vim, but similar. bind "main" "K" = "move-link-prev" bind "main" "J" = "move-link-next" # Move up/down like in mutt. bind "main" "-" = "move-page-up" bind "main" "Space" = "move-page-down" # Move to the start and end of the document similar to Vim. bind "main" "g" = "move-document-start" bind "main" "G" = "move-document-end" # Reload the page. bind "main" "r" = "reload" # Open "Go to URL" dialog. bind "main" "o" = "goto-url" bind "main" "O" = "goto-url-current" # Open a new tab in background. bind "main" "Alt-t" = "open-new-tab-in-background" # Close a tab, similar to Vim's :q. bind "main" "q" = "tab-close" # Don't use "c" to close a tab as it's to dangerous for me; too similar to # screen's "c" which creates a new window. bind "main" "c" = "none" # Unbind Q (quit without warning) as it's too dangerous. bind "main" "Q" = "none" # vim: ft=elinks