Block back buton.

Hi! How can I disable the back button in a browser? I found this, but how can I make it work with Corvid?

<script>
  function preventBack(){window.history.forward();}
  setTimeout("preventBack()", 0);
  window.onunload=function(){null};
</script>

Note that I want my visitors to be able to return to the previous page with an in-page button.
Thanks in advance.

You can try add an html component to a global element (such as site header), and put this code inside. Maybe it’ll work.
On side note: I think disabling the browser back is a terrible UX.

Apps I think it was onBackPress that you could set to true so that it wouldn’t proceed, but not done that for years.

Quick search and exactly as J. D. tells you.
https://www.aspsnippets.com/Articles/Disable-Browser-Back-Button-Functionality-using-JavaScript.aspx

But doing that will disable the back button on all my pages, which will ruin the UX. I only want to do that on some subpages that my site has. How can I do that?

hey! did you find a solution thou?)