Skip to content

Commit

Permalink
revert: handle redirections for iframed content (#557) (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay authored Sep 13, 2024
1 parent 0716af8 commit 6e203e4
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions src/Window.res
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,21 @@ let getRootHostName = () =>
}

let replaceRootHref = (href: string) => {
switch isIframed() {
| true =>
try {
Top.Location.replace(href)
} catch {
| e => {
Js.Console.error3(
"Failed to redirect root document",
e,
`Using [window.location.replace] for redirection`,
)
Location.replace(href)
}
}
| false => Location.replace(href)
}
Location.replace(href)
// switch isIframed() {
// | true =>
// try {
// Top.Location.replace(href)
// } catch {
// | e => {
// Js.Console.error3(
// "Failed to redirect root document",
// e,
// `Using [window.location.replace] for redirection`,
// )
// Location.replace(href)
// }
// }
// | false => Location.replace(href)
// }
}

0 comments on commit 6e203e4

Please sign in to comment.