0

I want to know about iframe cross-origin. Let’s say I have site : load-me-from-iframe.com And I have another site named iframe-loader.com that will load site above.

How to know that load-me-from-iframe.com was loaded inside iframe from iframe-loader.com ?

In this case, I will show the notification that will appear in load-me-from-iframe.com when it loaded from iframe-loader.com

Let me know and thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Luxor
  • 45
  • 1
  • 9

1 Answers1

0

Is this answer of any help:

Access parent URL from iframe

var url = (window.location != window.parent.location) ? document.referrer : document.location.href;

That will access the url of the page the document is loaded from. Wether that be directly or via an iframe.

Jack Templeman
  • 344
  • 1
  • 9