Adding a callback to be called before contextmenu to be open