From fa5ac4040e8e2fc57bef5c598e1ceda4c2fc0a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Sun, 5 Oct 2025 15:16:20 +0200 Subject: feat(backend): add noreferer on external link and move target blank --- frontend/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'frontend') diff --git a/frontend/index.ts b/frontend/index.ts index 9babe4a..d4fbe2a 100644 --- a/frontend/index.ts +++ b/frontend/index.ts @@ -4,10 +4,8 @@ htmx.config.historyRestoreAsHxRequest = false; function setupAnchors() { document.querySelectorAll("a").forEach(e => { - if (!e.href.startsWith(window.location.origin) && /https?:\/\//.test(e.href)) { - e.target = "_blank"; - return - } + // stuff related to external links are already handled in the backend + if (!e.href.startsWith(window.location.origin) && /https?:\/\//.test(e.href)) return if (e.hasAttribute("hx-trigger")) return; e.setAttribute("hx-get", e.href) e.setAttribute("hx-trigger", "click") -- cgit v1.2.3