diff options
| author | William Hergès <william@herges.fr> | 2025-10-04 19:53:47 +0200 |
|---|---|---|
| committer | William Hergès <william@herges.fr> | 2025-10-04 19:53:47 +0200 |
| commit | 52e85e838e7bbd7fa8860e175701303c81db9217 (patch) | |
| tree | ee03bca387e0acbd36bc1957530f4e647d58eb23 /frontend/index.ts | |
| parent | a4374f68e6d41fc1a8d7f70eca9fb817d47ec595 (diff) | |
fix(frontend): prevent modifying internal anchors in non standard implementation
Diffstat (limited to 'frontend/index.ts')
| -rw-r--r-- | frontend/index.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/index.ts b/frontend/index.ts index 13997b3..ee1e7ae 100644 --- a/frontend/index.ts +++ b/frontend/index.ts @@ -2,7 +2,7 @@ import htmx from "htmx.org"; function setupAnchors() { document.querySelectorAll("a").forEach(e => { - if (!e.href.startsWith(window.location.origin)) { + if (!e.href.startsWith(window.location.origin) && /https?:\/\//.test(e.href)) { e.target = "_blank"; return } |
