GitHub user dosubot[bot] added a comment to the discussion: Embedded dashoard
with external iframe in Superset dashboard
<!-- Greeting -->
Hello @felipegarciaign! I'm here to help you solve bugs, answer questions, and
navigate your way through contributions. I'll be assisting you while you wait
for a human maintainer. Let's tackle your issue together!
<!-- Answer -->
To embed an external iframe in a Superset dashboard, you need to adjust the
HTML sanitization settings. Here's a solution based on a similar discussion:
1. **Modify `superset_config.py`:** You need to extend the HTML sanitization
schema to allow iframes. Add the following configuration to your
`superset_config.py`:
```python
HTML_SANITIZATION_SCHEMA_EXTENSIONS = {
"attributes": {
"*": ["style", "className"],
"iframe": ["src"]
},
"tagNames": ["style", "iframe"],
}
```
2. **Update Content Security Policy (CSP):** Specify the allowed sources for
iframes in the CSP. Add the following to your configuration:
```python
TALISMAN_CONFIG = {
"content_security_policy": {
"frame-src": [
"'self'",
"https://example.com",
],
}
}
```
These changes will allow you to use iframes in your dashboard. Make sure to
restart your Superset server after making these changes to apply them
<sup>[[1]](https://github.com/apache/superset/discussions/27064)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great
Response](https://app.dosu.dev/response-feedback/6ec4d67d-1c90-4b7d-bfb2-329ed5e15f3d?feedback_type=great_response)
| [Irrelevant
Answer](https://app.dosu.dev/response-feedback/6ec4d67d-1c90-4b7d-bfb2-329ed5e15f3d?feedback_type=irrelevant_answer)
| [Incorrect
Sources](https://app.dosu.dev/response-feedback/6ec4d67d-1c90-4b7d-bfb2-329ed5e15f3d?feedback_type=incorrect_sources)
| [Too
Verbose](https://app.dosu.dev/response-feedback/6ec4d67d-1c90-4b7d-bfb2-329ed5e15f3d?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/6ec4d67d-1c90-4b7d-bfb2-329ed5e15f3d?feedback_type=hallucination)
| [Bug
Report](https://app.dosu.dev/response-feedback/6ec4d67d-1c90-4b7d-bfb2-329ed5e15f3d?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/6ec4d67d-1c90-4b7d-bfb2-329ed5e15f3d?feedback_type=other)</sup>
GitHub link:
https://github.com/apache/superset/discussions/33129#discussioncomment-12839591
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]