Skip to content

Commit 453ef38

Browse files
committed
fix(opener): doesn't open same origin links
1 parent 5204145 commit 453ef38

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"opener": patch
3+
"opener-js": patch
4+
---
5+
6+
Fix opener doesn't open same origin links in the browser

plugins/opener/guest-js/init.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ window.addEventListener('click', function (evt) {
4646

4747
// return early if
4848
if (
49-
// same origin (internal navigation)
50-
url.origin === window.location.origin
5149
// not default protocols
52-
|| ['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p)
50+
['http:', 'https:', 'mailto:', 'tel:'].every((p) => url.protocol !== p)
5351
)
5452
return
5553

plugins/opener/src/init-iife.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)