identify iframe pages in htmlviewer

Hi,
I need a way to know if a webaddress is in iframes and as such not able to view it in a htmlviewer. If this is possible Then i could implement to automatically view in a new browser tab using showURL(webaddress, true)

Unless the page is on the same server as your app, you have no access to the URL displayed in the WebHTMLViewer. It is an HTML security limitation, there is no workaround I am aware of.

I am aware about Michael. But if there is acwaybto knoe this in advance so to find other ways show in eg in users’ browser such as Chrome ?

Michel is pretty much on the money. Just because you want to be able to do it, doesn’t mean it’s allowed.

Xojo Web apps are pretty limited, so maybe we can find an alternative route that will work :slight_smile:
What is the actual, end user perceived effect that you’re trying to implement?

Well, The user can choose websites to store in a list. When choose one on the list, it is shown to htmlviewer. But in some, there is shown nothing, so in these cases instead of this, the user could see it in a new browser tab and not seen a blank empty space. So i need to be able to know that a htmlviewer’s url when set, is impossible to be shown to that html viewer and leave it blank empty space.

Keep in mind that any website can prevent being shown in a WebHTMLViewer with a security header because it’s an iframe itself.

Thanks. So the solution is to check the header. Is there any particular stantard string?

The header is X-Frame-Options.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options