searxng/searx/templates/simple
Markus Heiser d2b3c92e81 [fix] move initial "JS is enabled?" (no-js) to client side
To avoid an `unsafe-inline` in the CSP header, the JS code must be moved to the
client side [1].

The `<script>` tag at the end of the HTML originates from the old implementation
of the JS client. Since PR-5073 [2] was merged, the `type` is now `module`, and
the tag must be moved to the beginning of the HTML.

> We need to inline this "JS is enabled?" thing to prevent layout shifts and
> temporary "no JS enabled" visuals as ESM scripts loads and evals everything
> deferred from initial DOM render [3]

That's true in theory, but in practice, this effect is unnoticeable because it's
masked by another effect (which we can't avoid): If we load the page with a
severely throttled connection, the HTML (result list) takes a long time to
load. Then the CSS is loaded, which also takes longer. Until the CSS has loaded,
there's no layout. A layout shift is therefore largely determined by the loading
of the HTML and CSS itself.

The running times of the ESM script can be neglected compared to the loading
times of HTML & CSS.

[1] https://github.com/searxng/searxng-docker/pull/424#issuecomment-3199494256
[2] https://github.com/searxng/searxng/pull/5073
[3] https://github.com/searxng/searxng-docker/pull/424#issuecomment-3199622504
2025-08-21 09:07:08 +02:00
..
answer [mod] weather results: add types, i18n/l10n, symbols & unit conversions 2025-05-31 20:34:59 +02:00
elements [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
filters [fix] webapp: safesearch uses wrong default value (#5134) 2025-08-20 14:39:05 +02:00
messages [mod] simplify no results on pages > 1 to "There are no more results." 2023-12-23 09:50:39 +01:00
preferences [fix] template: safesearch uses the wrong type (#5136) 2025-08-20 18:04:13 +02:00
result_templates [feat] engines: add GitHub Code Search engine (#5074) 2025-08-20 07:35:31 +02:00
404.html Drop Python 2 (2/n): templates 2020-09-10 10:39:04 +02:00
base.html [fix] move initial "JS is enabled?" (no-js) to client side 2025-08-21 09:07:08 +02:00
categories.html [web-client] simple theme: refactor jinja_svg_catalog and cleanup icon names 2025-02-28 12:27:41 +01:00
icons.html [build] /static 2025-05-09 12:40:34 +02:00
index.html Workaround: index.html: remove image preload 2022-06-18 09:04:13 +02:00
info.html Theme: add Help and Donate links in all pages 2022-06-25 20:31:40 +02:00
macros.html [enh] tidy: clean old morty, filtron, searx references 2025-05-13 10:37:02 +02:00
new_issue.html [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
opensearch.xml [fix] opensearxh.xml: firefox v123 does not except self-URI (URL with param) 2024-02-25 07:33:04 +01:00
opensearch_response_rss.xml [mod] add CSS (LESS) to xsl style to view rss in browser 2024-11-25 09:34:02 +01:00
page_with_header.html [mod] template preferences: split into elements (no functional change) 2023-06-02 19:05:43 +02:00
preferences.html [web-client] simple theme: refactor jinja_svg_catalog and cleanup icon names 2025-02-28 12:27:41 +01:00
results.html [web-client] simple theme: refactor jinja_svg_catalog and cleanup icon names 2025-02-28 12:27:41 +01:00
rss.xsl [mod] add CSS (LESS) to xsl style to view rss in browser 2024-11-25 09:34:02 +01:00
search.html [refactor] search.js: use custom auto completion implementation 2025-05-22 15:16:54 +02:00
searxng-wordmark.min.svg [build] /static 2024-12-01 15:04:05 +01:00
simple_search.html [refactor] search.js: use custom auto completion implementation 2025-05-22 15:16:54 +02:00
stats.html [web-client] simple theme: refactor jinja_svg_catalog and cleanup icon names 2025-02-28 12:27:41 +01:00