Reputation: 5419
I have an iframe that has an alert function and a console.log function.
I am able to see the output from the console.log, however the alert function is not bubbling up (never gets fired in a way that is visible).
I tried disabling web security on chromium, as well as disabling popup-blocking via command line flags both did not have the desired effect. How can I allow popups to bubble through without changing the code in the iframe?
Note: This is the chromium web driver running in Atom.
Upvotes: 3
Views: 1804
Reputation: 9457
I created two jsfiddles, the first https://jsfiddle.net/c9mougua/6/ has an <iframe>
linking to another jsfiddle https://jsfiddle.net/ypptc1f8/3/ which has the alert()
and this is working correctly.
Make sure you are calling your alert correctly and also if you have the javascript on the first page trying to call it in the Iframe that will not work either. The alert()
needs to be called inside the actual second page and not the <iframe>
itself.
first page
<body>
<iframe src="https://jsfiddle.net/ypptc1f8/3/">
</iframe>
</body>
second page
<body onload="test()">
</body>
<script>
function test(){
alert("Inside IFrame");
}
</script>
Upvotes: 2