# Iframe to embed an html document

**URL:** https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486
**Category:** Support
**Created:** [December 17, 2018, 6:03pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486 "2018-12-17T18:03:39Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Globulle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/globulle/32/98005_2.png) [@Globulle](https://meta.discourse.org/u/Globulle)
#### Post date: [December 17, 2018, 6:03pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/1 "2018-12-17T18:03:39Z")

</div>

Hello there,

I would like to embed a [Sozi presentation](http://sozi.baierouge.fr/) (html document) in Discourse but it does not work. (nothing appear in the post)

The code should be (see [here](http://sozi.baierouge.fr/pages/tutorial-embedding.html)) :

```
<iframe class="sozi" src="http://sozi.baierouge.fr/presentations/this-is-not-a-slideshow.sozi.html">
    Your browser cannot display this content.
</iframe>

```

I presume that if I upload the Sozi html document first in the post and use its Discourse upload URL there should be no problem with the `allowed iframe` parameter?

Thanks for your help!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [December 17, 2018, 6:20pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/2 "2018-12-17T18:20:20Z")

</div>

One issue may be the insecure URL … it’s using ‘http’.

My console reports that content to be blocked because of this (the site I tested it on is secured with https)

```plaintext
The page at 'https://www.mycoolsite.com/t/new-iframe-test/46' was loaded over HTTPS, but requested an insecure resource 'http://sozi.baierouge.fr/presentations/this-is-not-a-slideshow.sozi.html'. This request has been blocked; the content must be served over HTTPS.

```

---

<div class="post-metadata">

### Author: ![Globulle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/globulle/32/98005_2.png) [@Globulle](https://meta.discourse.org/u/Globulle)
#### Post date: [December 17, 2018, 7:46pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/3 "2018-12-17T19:46:30Z")

</div>

Thank you, but I’m not convinced, since my first try was with a presentation of my own, that I uploaded inside discourse. Thus it was in https :

```
<iframe src="https://mydiscourse.com/uploads/default/original/1X/b0a38624276ef8cddd85d6c2d0faad0ac3eb81ae.html">
      My presentation
</iframe>

```

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [December 17, 2018, 8:11pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/4 "2018-12-17T20:11:50Z")

</div>

Now you are making a big assumption.

For that content to work it probably needs a massive JavaScript script (confrmed, i’ve just looked at it) Uploading the document almost certainly won’t allow the script to run (imagine if your users were allowed to upload random javascript!)

You could try to create a Theme Component and include the script …

… but that’s not going to create a situation where people can upload presentations of this type in an ad-hoc fashion.

---

<div class="post-metadata">

### Author: ![Globulle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/globulle/32/98005_2.png) [@Globulle](https://meta.discourse.org/u/Globulle)
#### Post date: [December 17, 2018, 8:38pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/5 "2018-12-17T20:38:12Z")

</div>

OK, I understand now. Thanks.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [December 17, 2018, 8:39pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/6 "2018-12-17T20:39:20Z")

</div>

To begin to solve it please ask that site to upgrade to https (why the heck not, its 2018, its more secure, and its free to do so) … then retest.

[Let me link something similar that works:](https://meta.discourse.org/t/turning-a-topic-into-interactive-fiction/87885)

You will note the linked web page is https enabled.

---

<div class="post-metadata">

### Author: ![Globulle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/globulle/32/98005_2.png) [@Globulle](https://meta.discourse.org/u/Globulle)
#### Post date: [December 18, 2018, 4:58pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/7 "2018-12-18T16:58:54Z")

</div>

Should be difficult to ask for https…  
Instead I propose to upload [the test document](http://sozi.baierouge.fr/presentations/this-is-not-a-slideshow.sozi.html) here… (89 ko). That would be exactly the same conditions as mine. Problem: I’m not able to upload an html file.

---

<div class="post-metadata">

### Author: ![Globulle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/globulle/32/98005_2.png) [@Globulle](https://meta.discourse.org/u/Globulle)
#### Post date: [December 19, 2018, 5:17pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/8 "2018-12-19T17:17:56Z")

</div>

Hi @merefield,

I have done another test, with a proper external https URL and you are right : it works ! Thanks ! 🙂

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [December 19, 2018, 5:32pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/9 "2018-12-19T17:32:42Z")

</div>

Awesome. Glad that’s resolved. 🙂

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 18, 2019, 5:41pm UTC](https://meta.discourse.org/t/iframe-to-embed-an-html-document/104486/10 "2019-01-18T17:41:14Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
