summaryrefslogtreecommitdiff
path: root/searx/templates/simple/macros.html
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2026-05-06 09:29:20 +0200
committerGitHub <noreply@github.com>2026-05-06 09:29:20 +0200
commit330d56bba9dfc1c7cfd1bcf027d092bc73d1ed10 (patch)
treece9450641fa920a85b262c3ea31c01ffaa538e6a /searx/templates/simple/macros.html
parent36bcd6b551c0f4850767a1cfe4c6b64e7e2c543f (diff)
[mod] result templates: move iframe to macro and fix page rendering for non-YouTube links (#5960)
This PR moves the `iframe` logic into a macro, so that `videos.html` and `general.html` both can benefit from the workaround to fix YouTube results by @return42 in https://github.com/searxng/searxng/pull/5858 It also fixes that only YouTube videos contained the closing `>` after `<iframe border="0" ...`, the regression has been caused by https://github.com/searxng/searxng/pull/5858 ## Why is this change important? Currently, the page breaks if there's any non-YouTube Iframe Here, the page ends in the middle of the results and the footer and page number selector are not visible.
Diffstat (limited to 'searx/templates/simple/macros.html')
-rw-r--r--searx/templates/simple/macros.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html
index c3e3a9b84..8941b6820 100644
--- a/searx/templates/simple/macros.html
+++ b/searx/templates/simple/macros.html
@@ -67,3 +67,13 @@
class="checkbox-onoff"{{- ' ' -}}
{%- if checked -%} checked{%- endif -%}/>
{%- endmacro -%}
+
+<!-- iframe that additionally sets some extra feature attrs for videos -->
+{%- macro iframe(iframe_src) -%}
+ <iframe data-src="{{iframe_src}}" frameborder="0" allowfullscreen
+ {% if result.parsed_url.hostname in ("www.youtube.com", ) -%}
+ allow="picture-in-picture" referrerpolicy="origin"
+ {%- endif -%}
+ >
+ </iframe>
+{%- endmacro -%}