summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorIvan Gabaldon <igabaldon@inetol.net>2025-07-06 12:27:28 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-08-18 16:38:32 +0200
commit60bd8b90f04d5d825fc8ac279cb7fdfde9fe78ea (patch)
tree19b2639638e7845597f9aa839eda39a456188a1c /searx/webapp.py
parentadc4361eb919604889dc0661e75ef6ac8cfc4d23 (diff)
[enh] theme/simple: custom router
Lay the foundation for loading scripts granularly depending on the endpoint it's on. Remove vendor specific prefixes as there are now managed by browserslist and LightningCSS. Enabled quite a few rules in Biome that don't come in recommended to better catch issues and improve consistency. Related: - https://github.com/searxng/searxng/pull/5073#discussion_r2256037965 - https://github.com/searxng/searxng/pull/5073#discussion_r2256057100
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 4179c32b0..2dd7ddb08 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -358,7 +358,7 @@ def get_client_settings():
'favicon_resolver': req_pref.get_value('favicon_resolver'),
'advanced_search': req_pref.get_value('advanced_search'),
'query_in_title': req_pref.get_value('query_in_title'),
- 'safesearch': str(req_pref.get_value('safesearch')),
+ 'safesearch': req_pref.get_value('safesearch'),
'theme': req_pref.get_value('theme'),
'doi_resolver': get_doi_resolver(),
}
@@ -368,15 +368,7 @@ def render(template_name: str, **kwargs):
# values from the preferences
# pylint: disable=too-many-statements
client_settings = get_client_settings()
- kwargs['client_settings'] = str(
- base64.b64encode(
- bytes(
- json.dumps(client_settings),
- encoding='utf-8',
- )
- ),
- encoding='utf-8',
- )
+ kwargs['client_settings'] = base64.b64encode(json.dumps(client_settings).encode('utf-8')).decode('utf-8')
kwargs['preferences'] = sxng_request.preferences
kwargs.update(client_settings)