Hello
I'm trying to add a simple "back" button in my app, using:
window.history.back()
However, the script doesn't seem to work.
Does anyone have any advice on adding a back button to navigate to the user's previous URL?
Hello
I'm trying to add a simple "back" button in my app, using:
window.history.back()
However, the script doesn't seem to work.
Does anyone have any advice on adding a back button to navigate to the user's previous URL?
Hey @kierandoyle!
Retool runs its JavaScript in a sandboxed environment so you won't have access to the parent window's history
methods as you've noticed. The closest I'm thinking over here is to use something like localStorage to store the last Retool app the user visited, but that's a relatively small subset of URLs that the user might be navigating from.
Would you mind explaining more about your use case? I'm wondering if there are any other possible workarounds.
Hey folks!
As Kabirdas said, custom JS code won't have access to the window history with it being sandboxed, but it is doable with a custom component that has access to the top-level navigation!
-Justin
great, thanks !