Q: Cannot execute code from a freed script error on IE 10 I have a use case where I subscribe / listen to a topic on every iframe, now occasionally this iframe will be removed and replaced with a new iframe.
Also, I don't have a clean way to unsubscribe to the initial subscriber on the removed iframe.
In Chrome, when an event is published on the removed iframe subscription, it's caught in the try / catchblock, however in IE10 it outright throws an error "Cannot execute on a freed script"
iframe 1 (Which will be removed from the DOM)
subscribe("event-topic", (event) {
   try { ... }
   catch(ex) { ... }
})

iframe 2
subscribe("event-topic", (event) {
   try { ... }
   catch(ex) { ... }
})

Main Application
publish("event-topic");

Now, as an example, the 1st iframe is removed and 2nd iframe is added. The main application starts to publish the event. This publish results in both the subscribers callbacks being invoked. Now since the 1st iframe is not there anymore, Chrome sends this to the try/catch block in the subscribe callback while IE throws an error. 
I tried to add the unsubscription mechanism when the iframe is removed but that's resulting in a lot of junk code which I would want to avoid as much as possible.
Did anyone resolve this issue or is there a workaround to get IE to behave the same way as Chrome? Like a polyfill?
