fix(opener): doesn't open same origin links (#3018)

This commit is contained in:
Tony
2025-10-04 21:16:08 +08:00
committed by GitHub
parent e25a9339f4
commit 67a7bf80f8
3 changed files with 8 additions and 4 deletions
+1 -3
View File
@@ -46,10 +46,8 @@ window.addEventListener('click', function (evt) {
// return early if
if (
// same origin (internal navigation)
url.origin === window.location.origin
// not default protocols
|| ['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p)
['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p)
)
return