How to know if a site can be loaded in an iframe or not?

Viewed 21

I have designed a website containing an iframe that loads another website that I previously designed in Django. However, the content website contains links to pages that may or may not be contained in an iframe. To solve this problem, my iframe would have to be able to know if a link leads to a page that it can contain and if not open the page of the link in a new tab. However, I don't know which property to use in order to know if a page allowing loading in an iframe. Also, I hope to get your help. Here is the code of my iframe:

export default function SearchEngine() {
  return (
    <iframe
      width="100%"
      height="1300"
      src="https://gkwhelps.herokuapp.com"
    ></iframe>
  );
}

Thanks!

0 Answers
Related