cancel window
execute event "cancel"
if window is in update/new mode, it execute event "cancel:update"
set return value "ok" to false
return -1, if not possible
return 1 if possible. Note: if window is closed, the script is stopping in this place
window.cancel();