You can try something like this:
1. Change the iframe to point to your server. If you load it via Javascript then do the next steps on the client side.
2. On your server add an endpoint for iframe. This URL will load the original iframe and inject Javascript.
3. In the injected code (for the iframe only), override the `window.open` function
Code:
window.open = function(strUrl, strWindowName, [strWindowFeatures]){
// your custom code
}
// or just ignore all the popups in the iframe
window.open = null