开发者

Override Alert Message from an IFrame?

开发者 https://www.devze.com 2023-01-20 01:10 出处:网络
I\'ve been trying to capture the alert dialog of an iframe unsuccessfully. The iframe is on a different subdomain but the same domain.

I've been trying to capture the alert dialog of an iframe unsuccessfully. The iframe is on a different subdomain but the same domain.

This doesn't seem to log the output to Firebug from the iframe Alerts

function alert(message) {
        console.info(message);
    }

Do I need to reference the iframe by it's DOM layer somehow? Is window.alert specific to the entire DOM tree?

开发者_如何学JAVAThanks


If the iFrame is on a different subdomain, you can't override there anything out of the parent-window, according to same-origin-policy.

0

精彩评论

暂无评论...
验证码 换一张
取 消