about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--doc/config.md15
-rw-r--r--src/config/config.nim1
-rw-r--r--src/local/pager.nim1
3 files changed, 14 insertions, 3 deletions
diff --git a/doc/config.md b/doc/config.md
index e1b359f5..b55cf74b 100644
--- a/doc/config.md
+++ b/doc/config.md
@@ -120,7 +120,8 @@ Following is a list of buffer options:
 <td>styling</td>
 <td>boolean</td>
 <td>Enable/disable author style sheets. Note that disabling this does not affect
-user styles set in `[css]`.</td>
+user styles set in `[css]`.<br>
+Defaults to true (i.e. enabled).</td>
 </tr>
 
 <tr>
@@ -158,6 +159,14 @@ option disabled, only enabling it for specific sites in `[[siteconf]]`.
 </td>
 </tr>
 
+<tr>
+<td>autofocus</td>
+<td>boolean</td>
+<td>When set to true, elements with an "autofocus" attribute are focused on
+automatically after the buffer is loaded.<br>
+Defaults to false</td>
+</tr>
+
 </table>
 
 ## Search
@@ -784,8 +793,8 @@ are doing.</td>
 <tr>
 <td>autofocus</td>
 <td>boolean</td>
-<td>Defaults to false. When set to true, elements with an `autofocus' attribute
-are focused on automatically after the buffer is loaded.</td>
+<td>When set to true, elements with an "autofocus" attribute are focused on
+automatically after the buffer is loaded. Overrides buffer.autofocus.</td>
 </tr>
 
 </table>
diff --git a/src/config/config.nim b/src/config/config.nim
index 4e9d1517..1ab77f01 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -147,6 +147,7 @@ type
     images* {.jsgetset.}: bool
     cookie* {.jsgetset.}: bool
     referer_from* {.jsgetset.}: bool
+    autofocus* {.jsgetset.}: bool
 
   Config* = ref object
     jsctx: JSContext
diff --git a/src/local/pager.nim b/src/local/pager.nim
index f3d4d79a..f6345dfb 100644
--- a/src/local/pager.nim
+++ b/src/local/pager.nim
@@ -1115,6 +1115,7 @@ proc applySiteconf(pager: Pager; url: var URL; charsetOverride: Charset;
     charsets: pager.config.encoding.document_charset,
     images: pager.config.buffer.images,
     styling: pager.config.buffer.styling,
+    autofocus: pager.config.buffer.autofocus,
     isdump: pager.config.start.headless,
     charsetOverride: charsetOverride,
     protocol: pager.config.protocol