# Supporting iframe embeds from different domains?

**URL:** https://meta.discourse.org/t/supporting-iframe-embeds-from-different-domains/30930
**Category:** Feature
**Created:** [9 Julho , 2015 15:30 UTC](https://meta.discourse.org/t/supporting-iframe-embeds-from-different-domains/30930 "2015-07-09T15:30:50Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [9 Julho , 2015 19:41 UTC](https://meta.discourse.org/t/supporting-iframe-embeds-from-different-domains/30930/2 "2015-07-09T19:41:58Z")

</div>

_iframes can now be whitelisted through the **allowed\_iframes** Site Setting. It accepts a list of iframe src domain prefixes that discourse can safely allow in posts. The whitelist-iframe plugin is no longer required._

* * *

What I have done is make a plugin that calls the `Discourse.Markdown.whiteListIframe` function. The plugin is very simple, The hard part is that you have to supply regular expressions to match any URLs you want to white-list. The code is here. [https://github.com/scossar/whitelist-iframe](https://github.com/scossar/whitelist-iframe)

You can test any URLs you wish to whitelist in your web browser’s console window. For example, if you open the browser’s console from a Discourse forum and then enter the following line, you should be able to embed iframes from Freesound.

```plaintext
window.Discourse.Markdown.whiteListIframe(/^(https?:)\/\/www\.freesound\.org\/embed\/sound\/iframe\/.+/i);

```

There may be an easier way to do this. 🙂

---

_[View the full topic](https://meta.discourse.org/t/supporting-iframe-embeds-from-different-domains/30930)._
