plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Docs: "Download as HTML" recommends using a `data:` URL, which is restricted in Dash>=2.15.0

Open ndrezn opened this issue 1 year ago • 1 comments

In: https://plotly.com/python/interactive-html-export/

we have an example which recommends:

    html.A(
        html.Button("Download as HTML"), 
        id="download",
        href="data:text/html;base64," + encoded,
        download="plotly_graph.html"
    )

However, data: URLs are restricted in 2.15.0. We can wait until they're unrestricted, or, better off just changing this example to recommend using dcc.Download instead.

Originally reported in: https://community.plotly.com/t/dangerous-link-detected-when-running-dash-example/83356

ndrezn avatar Mar 27 '24 19:03 ndrezn

Related: https://github.com/plotly/dash/issues/2764, which discusses allowing data: attribute in certain cases.

ndrezn avatar Mar 27 '24 19:03 ndrezn