From fb39dc533c6df0871059bafdfe96bc8eb933d7a4 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Tue, 10 Dec 2024 22:21:32 +0100 Subject: [PATCH] feat(tag): better behavior for tag with internal link --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index c3f46b0..e1feaec 100644 --- a/index.ts +++ b/index.ts @@ -3,7 +3,8 @@ function setupEvents() { t.addEventListener("click", _ => { const link = t.getAttribute("data-href") if (link === null || link === "") return - window.open(link) + if (!link.startsWith(window.location.origin) && link.startsWith("https://")) window.open(link) + else changePage(link) }) })