embed content from another site

608
1
02-21-2021 06:13 PM
AlistairFox2
New Contributor

is there a way to configure your website / server to allow content to be consumed by an AGOL experience embed widget - get around the error below

 

AlistairFox2_0-1613959907939.png

 

the browser error thrown is this - 

Refused to display 'url xx' in a frame because it set 'X-Frame-Options' to 'sameorigin' - can we set the header to allow this to be loaded?

 

Tags (1)
0 Kudos
1 Reply
kevinkatler
New Contributor

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.

 

0 Kudos