diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-12 00:22:18 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-12 00:22:18 +0100 |
commit | 4874b92f0d177c0a7e84c1dd106f9b16eec7cb05 (patch) | |
tree | 6b0b9f31ee2f9b0f6f3d88317e1d1759b4a783e6 /src/config | |
parent | bce29ef14df2fc8cc4cd227d6ef5af6f16b377fd (diff) | |
download | chawan-4874b92f0d177c0a7e84c1dd106f9b16eec7cb05.tar.gz |
Add urlfilter
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/config.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config/config.nim b/src/config/config.nim index aa67152d..3144b6fa 100644 --- a/src/config/config.nim +++ b/src/config/config.nim @@ -5,9 +5,11 @@ import streams import buffer/cell import config/toml +import io/urlfilter import js/javascript import js/regex import types/color +import types/url import utils/twtstr type @@ -49,6 +51,7 @@ type BufferConfig* = object userstyle*: string + filter*: URLFilter ForkServerConfig* = object tmpdir*: string @@ -60,8 +63,9 @@ func getForkServerConfig*(config: Config): ForkServerConfig = ambiguous_double: config.ambiguous_double ) -func getBufferConfig*(config: Config): BufferConfig = +func getBufferConfig*(config: Config, location: URL): BufferConfig = result.userstyle = config.stylesheet + result.filter = newURLFilter(scheme = some(location.scheme)) proc getSiteConfig*(config: Config, jsctx: JSContext): seq[SiteConfig] = for sc in config.siteconf: |