Knut Arne Vedaa
Knut Arne Vedaa

Reputation: 15742

Iframe embedded content not loading

I am using an <iframe> HTML tag on my page e.g. to embed content from YouTube:

<iframe src="https://www.youtube.com/embed/DnPQNOq8x2s"></iframe>

However the content is not loaded.

In Firefox nothing is shown. In Chrome, a message like "Request blocked by an extension" is shown.

What is blocking the embedded iframe content and how can I get it to load and be shown?

Upvotes: 1

Views: 1381

Answers (1)

Knut Arne Vedaa
Knut Arne Vedaa

Reputation: 15742

This is probably due to the Content Security Policy HTTP response header.

If your HTTP framework or server is configured to insert this header into the response, you should make sure that you set the frame-src directive for it:

Content-Security-Policy: frame-src *.youtube.com; (or equivalent for any site you want to embed)

The documentation for your HTTP server or framework should specify how to configure this.

Upvotes: 1

Related Questions