[RESOLVED] Error Dialog Box - X-Frame-Options

Hi Community!

I have come across this error:

Refused to display 'https://myORG' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Here is the code that I'm using to display a dialog box:

//Dialog Box  
Dialog.open("https:myORG",
{width: 600, height: 600, title: "More Information"});

What does this mean and how can I fix this?

I don't want to display my organization for confidentiality purposes...

Hello @DryChips,

The error indicates that the site has disallowed loading of the resource in a frame outside of its domain.

You need to either change the X-Frame-Options property for the site or open the page in a new tab.

1 Like

Awesome, thanks for letting me know.

You cannot display a lot of websites inside an iFrame. Reason being that they send an "X-Frame-Options: SAMEORIGIN" response header. This option prevents the browser from displaying iFrames that are not hosted on the same domain as the parent page.

I faced the same error when displaying YouTube links. For example: https://www.youtube.com/watch?v=8WkuChVeL0s

I replaced watch?v= with embed/ so the valid link will be: https://www.youtube.com/embed/8WkuChVeL0s

It works well.

Try to apply the same rule on your case.

SAMEORIGIN

The page can only be displayed in a frame on the same origin as the page itself. The spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin.

1 Like