aboutsummaryrefslogtreecommitdiff
path: root/modules/eww-config.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/eww-config.el')
-rw-r--r--modules/eww-config.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/eww-config.el b/modules/eww-config.el
index a41a9a76e..3b0e22dcd 100644
--- a/modules/eww-config.el
+++ b/modules/eww-config.el
@@ -32,6 +32,8 @@
(require 'cl-lib)
+(declare-function eww-add-bookmark "eww")
+
(defgroup my-eww-user-agent nil
"EWW-only User-Agent management."
:group 'eww)
@@ -42,6 +44,13 @@
:type 'string
:group 'my-eww-user-agent)
+;; This file is lexical-binding, so `let'-binding url.el's special var below
+;; needs it declared special at compile time. Without this the byte-compiled
+;; advice binds `url-request-extra-headers' lexically and the injected
+;; User-Agent never reaches `url-retrieve' (it reads the dynamic value) -- the
+;; UA injection silently no-ops in compiled production, and the test sees nil.
+(defvar url-request-extra-headers)
+
(defun my-eww--inject-user-agent (orig-fun &rest args)
"Set a User-Agent only when making requests from an EWW buffer."
(if (derived-mode-p 'eww-mode)
@@ -64,6 +73,12 @@
;; --------------------------------- EWW Config --------------------------------
+(require 'system-lib)
+;; eww renders pages with shr, which paints with manual `face' properties. Left
+;; in `global-font-lock-mode' font-lock overwrites them and the page loses its
+;; colors, the same issue as elfeed-show and mu4e-view. Exclude eww-mode.
+(cj/exclude-from-global-font-lock 'eww-mode)
+
(use-package eww
:ensure nil ;; built-in
:bind