Skip to content

Commit

Permalink
fix isSameDomain
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Mar 8, 2024
1 parent 7541482 commit 535f498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function setSourceTabHash(event: PointerEvent, sourceInfo: SourceInfo) {

// Non authoritative test that url is for same domain
function isSameDomain(url: string) {
return !/^\w+:\/\//.test(url);
return new URL(url, window.location.href).origin === window.location.origin;
}

// That current sample so we don't reload an iframe if the user picks the same sample.
Expand Down

0 comments on commit 535f498

Please sign in to comment.