How to close alerts when navigating away from current page with HashRouting?

Mmmh… have you tried this with a form that defines its own before_unload?

I’m guessing the form class is defined then fed to the decorator, so you are replacing the one defined in the form.

Do you think it is possible to check whether the before_unload is already defined, and if it is, it decorate it with a function that first does our check, if it doesn’t it defines it as you did?