Not every site will load in an iFrame!The site owner can restrict it from being loaded in an iFrame. Most browsers will comply. Some might show a helpful error message.
Use this API to pre-check if a given URL will open in an iFrame.
Not every site will load in an iFrame!The site owner can restrict it from being loaded in an iFrame. Most browsers will comply. Some might show a helpful error message.
Use this API to pre-check if a given URL will open in an iFrame.
Call the end-point and pass the URL parameter with url=https://mytoori.com/
https://iframe-ok.mytoori.com/api/isiframe/?url=https://mytoori.com/The JSON response indicates if the URL can be loaded in an iFrame.
{"url":"https://mytoori.com/","iframe":true}Use it in your app or website to show a warning before loading the iFrame.
Try these
Verify a site directly into an iFrame alongside its JSON response.
Demo / SandboxA site owner can use the request headers to indicate if their site should not open in an iFrame. Typically the header X-Frame-Options will be set to DENY or SAMEORIGIN. The recommendation is to use the Content Security Policy however.