@Chrimaeon
import kotlinx.browser.window
fun main() {
// Add an initial state
window.history.pushState(null, "", window.location.href)
// Listen for back navigation
window.onpopstate = { event ->
println("Back button pressed!")
// Custom logic here, e.g., navigate within the app
// Optionally push another state to "trap" the back button
window.history.pushState(null, "", window.location.href)
}
}
I used the above code to achieve what i requested, the answer you gave was not satisfactory for me so I thought better to ping in #C0B8L3U69 channel, but because you commented with saying that is not possible I think no one answered my question. Please respond to the questions if you are 100 percent sure what you said is correct or else please let others answer .