I am trying to find a reliable solution to determine if my page was loaded in an iframe on an external site using javascript.
If iframe src is in the same domain, it is easy to cross: you can use if (window.frameElement) or if (window.location! == window.parent.location), but if modern ifre src is not in the same domain throw an exception when accessing the parent object and even compare it to null.
I am completely lost.
source share