# Invoke events when browser back/forward buttons are pressed

**URL:** <https://forum.inductiveautomation.com/t/invoke-events-when-browser-back-forward-buttons-are-pressed/87873>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [March 25, 2024, 11:47pm UTC](https://forum.inductiveautomation.com/t/invoke-events-when-browser-back-forward-buttons-are-pressed/87873 "2024-03-25T23:47:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheko29](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sheko29/32/25082_2.png) [@Sheko29](https://forum.inductiveautomation.com/u/Sheko29)\
**Post date:** [March 25, 2024, 11:47pm UTC](https://forum.inductiveautomation.com/t/invoke-events-when-browser-back-forward-buttons-are-pressed/87873/1 "2024-03-25T23:47:30Z")

</div>

Hi all,

Is there a way to send a message handler when the user presses the browser's back or forward buttons?

I added buttons to navigate in my applications so that if the user enters data in some fields and clicks my back button, it asks the user if he is sure to leave the page without saving.

But if the user uses the back/forward buttons of the browser, it just goes back. I want to prevent it.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 26, 2024, 3:58pm UTC](https://forum.inductiveautomation.com/t/invoke-events-when-browser-back-forward-buttons-are-pressed/87873/2 "2024-03-26T15:58:12Z")

</div>

You can not prevent basic browser behavior.

At most you can let the browser display a pop with its default warning message about leaving the page.

This will not be the popup you made for it
