aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2024-12-10 22:21:32 +0100
committerAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2024-12-10 22:21:32 +0100
commitfb39dc533c6df0871059bafdfe96bc8eb933d7a4 (patch)
treea524c68f5e218e2e03ba3c80994af5b56eff32ae
parentf06323ab2bb56f5a813f2dd88eed1c2a7cf31050 (diff)
feat(tag): better behavior for tag with internal link
-rw-r--r--index.ts3
1 files changed, 2 insertions, 1 deletions
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)
})
})