From 85735fabb28ebfc35622889b3bc98e6b5af49508 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Fri, 31 Mar 2023 13:03:46 +0100 Subject: [PATCH] Block external links. --- src/main/resources/q-apps/q-apps.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/q-apps/q-apps.js b/src/main/resources/q-apps/q-apps.js index b4060dc2..06d8f69a 100644 --- a/src/main/resources/q-apps/q-apps.js +++ b/src/main/resources/q-apps/q-apps.js @@ -348,6 +348,10 @@ function interceptClickEvent(e) { } e.preventDefault(); } + else if (href.startsWith("http://") || href.startsWith("https://") || href.startsWith("//")) { + // Block external links + e.preventDefault(); + } } if (document.addEventListener) { document.addEventListener('click', interceptClickEvent);