i know i can't access data in an iframe which displays a page from another domain. thats perfectly fine. but i'd like to detect, wether the iframe currently shows a page from my domain or something external.
my first attempt would be to try to access
$('iframe')[0].contentWindow.document
wrapped in try {} catch {}
, and if an error is thrown, it means, i can't access it, and therefore the iframe page must be external.
this sounds like a perfect solution, but the thing is, safari posts a "Unsafe JavaScript attempt to access frame with URL" to the javascript console.
this is not just ugly, but may cause other or future browsers to display explicit security warnings to the user?