How can I prevent Navigate forward?

I currently have a beforeunload event handler which exists when a form is dirty. it correctly blocks page a “Refresh” and navigating “Back”, but navigate “Forward” is not prevented.

window.addEventListener('beforeunload', (event) => {
    event.preventDefault();
})

This can happen if a user navigates back and starts filling out a form, I need to warn them that their data is not saved will be lost if they navigate forward again.

I thought about using popstate but that wont work either https://stackoverflow.com/a/32432366/10917416

Is there another event fired when Navigating forward?