Support Article
Events are not triggered, Permission denied error in IE11
Summary
Custom event are not triggered a second time (dispatch of event is not called) generating Permission denied error in IE11. This occurs when the use case is invoked many number of times after first iteration by closing the MDI window. Agent has to log out and log in again to see that callback method getting called again. The same use case works in Chrome browser, making the custom event to be dispatched multiple number of times.
Permission denied error in IE11 browser console pointing to dispatch function of eventmanager.js.
Error Messages
Permission denied error in IE11 browser console pointing to dispatch function of eventmanager.js
Steps to Reproduce
Invoke custom use case as an offering from the homepage using JSF pages that registers and dispatches the event.
Root Cause
Reported behavior is not observed in OOTB and is related to custom code.
First time execution of use case scenario, it registers the custom event on that window. And no unregisteration of that event has been fired when window is closed.
So in the second iteration, when it tries to register this event for that new window, it checks whether this event already exists for this new window. And in the below selected piece of code, it tries to execute a piece of code(&&oSelectedEventHanlder.window == oEventHandler.window) and throws the Permission denied error as it refers the window of closed window of the previous iteration.
function addRegisteredEvent(sEventName, sEventHandlerFunction, oWindow) {
….
for(var i=0; i < oRegisteredEvent.eventHandlers.length; i++) {
oSelectedEventHanlder = oRegisteredEvent.eventHandlers[i];
if(oSelectedEventHanlder.eventHandlerFunction == oEventHandler.eventHandlerFunction && oSelectedEventHanlder.window == oEventHandler.window){
return;
}
}
The problem appears to lie while unregistering of the custom event, which does not occur correctly for IE11.
Resolution
Recommended approach is to register, dispatch and unregister event prior to closing of MDI window through unregisterEvent or unregisterWindow function of eventmanager.js.
unregisterEvent or unregisterWindow function can be called on JSPX pages which get called on onUnload function.
Published November 4, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.