Is it possible in some way to detect if a URL is loaded via. iframe?
For instance to check, if domain.com is loaded or not loaded (if the site doesn't allow iframe loading of the website)?
Is it possible in some way to detect if a URL is loaded via. iframe?
For instance to check, if domain.com is loaded or not loaded (if the site doesn't allow iframe loading of the website)?
From the comments, the requirement is to detect when another site is loaded successfully in an IFrame under your control.
You can achieve that by simply hooking into the IFrame's onload
event.
Example:
<script>
function frameLoaded() {
alert("IFrame loaded.");
}
</script>
<iframe onload="frameLoaded()" src="https://www.bing.com"></iframe>
JSFiddle: https://jsfiddle.net/d1z62ctw/