mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix(iframe): handle URL origin check errors gracefully
- Add try-catch block to prevent errors during URL origin comparison - Fallback to opening link in new tab if origin check fails
This commit is contained in:
@@ -254,7 +254,13 @@ function openIframeDrawer(url: string) {
|
||||
const currentUrl = new URL(location.href)
|
||||
const destination = new URL(url)
|
||||
|
||||
if (!isSameOrigin(currentUrl, destination)) {
|
||||
try {
|
||||
if (!isSameOrigin(currentUrl, destination)) {
|
||||
openLinkToNewTab(url)
|
||||
return
|
||||
}
|
||||
}
|
||||
catch {
|
||||
openLinkToNewTab(url)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user