cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to block back browser button

Ritz
Active Contributor
0 Likes
1,326

Hello Experts,

Please share your thoughts here. I want the user to restrict and never use "Back button" from browser. Is it possible to achieve same using scripting?

Thanks

Ritesh

Accepted Solutions (1)

Accepted Solutions (1)

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert

This should apply here.

Personas scripting has no way to do it and using other methods in a flavor is not recommended, since it doesn't use the Personas scripting API.

Answers (1)

Answers (1)

Ritz
Active Contributor
0 Likes

As always thanks for helping me @tamas.hoznek in difficult times. My user is not actually clicking the browser arrow but the back button we all have on our mobile? so will this work with it? I am using Velocity browser.

<script type="text/javascript">
    window.history.forward();
    function noBack()
    {
        window.history.forward();
    }
</script>

<body onLoad="noBack();" onpageshow="if (event.persisted) noBack();" onUnload="">

Thanks

Ritesh

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert

I don't know that browser, but there is only one way to find out 🙂