I have an eventlistener
window.onbeforeunload=function(evt){
//causes pop up
}
I need to override it with another event listener for an iframe(Download case here). The below code is not working
var tIFrame = document.getElementById('Download');
iFrame.contentWindow.addEventListener('beforeunload', wrappedFn, false);
iFrame.addEventListener('beforeunload', wrappedFn, true);
Thanks @Bergi for the hint. The below code worked for me