superset icon indicating copy to clipboard operation
superset copied to clipboard

0.19.1 Markup chart type does not display on I.E.

Open victorho-ty opened this issue 9 years ago • 10 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [X] I have checked the superset logs for python stacktraces and included it here as text if any
  • [X] I have reproduced the issue with at least the latest released version of superset
  • [X] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.19.1

Expected results

Markup chart (with html code) to display fine in Internet Explorer.

Actual results

The chart shows empty in Internet Explorer.

Steps to reproduce

victorho-ty avatar Aug 29 '17 16:08 victorho-ty

Internet Explorer in 2017? Also without posting an actual error there's even less chances to have someone who doesn't have IE at hand to try to fix it.

xrmx avatar Aug 29 '17 16:08 xrmx

I´m having the same behavior here. I´m using markup boxes with 2 purposes. both with javascript code.

  1. I use a java script to print the last refresh time. (starting from 0.19.1 I can´t see the date on IE, chrome and Firefox works fine)
  2. using java script, I set a persistent autorefresh value. (starting from 0.19.1 this is not working at any browser. do you know where can I insert this code? I really need persistent refresh times)

this is the code.

<b><p id="demo" este>Display the result here.</p></b>

<script>
 
var d = new Date();
document.getElementById("demo").innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp; " + d.toLocaleString();

setTimeout(function() {
       location.reload();
}, 120000);
</script>

` Thanks

olbapito avatar Aug 29 '17 20:08 olbapito

My issue happens on Internet Explorer 11.

Similar to olbapito, my javascript code in the Html markup chart also stopped working. And for Html markup chart that does not have javascript, I.E doesn't output any display.

The html is along the similar lines of: ` document.getElementById("img_01").src="/images/.XXX.jpg?"+timestamp; ...

`

victorho-ty avatar Aug 30 '17 04:08 victorho-ty

That's a security feature, we now sandbox your html/markdown into an iframe to prevent CRSF attacks. We do allow scripting though. More about it here: https://www.w3schools.com/tags/att_iframe_sandbox.asp

mistercrunch avatar Aug 30 '17 04:08 mistercrunch

is good to hear that security is being taken in concern. Meanwhile and as a workaround to be able to use persistent autorefresh with JS, is there a way to turn sandboxing off? I´ve tried removing the sandboxing in markup.js without result. thanks

olbapito avatar Aug 30 '17 19:08 olbapito

what are you trying to autorefresh?

mistercrunch avatar Aug 30 '17 21:08 mistercrunch

The whole dashboard. I want to avoid people seeing outdated data because they didn´t remember to set the auto refresh every time the access the dashboard.

olbapito avatar Aug 31 '17 13:08 olbapito

@mistercrunch We are running into a similar issue -- we are in an enterprise environment and management uses Internet Explorer by default.

This feature isn't related to the contents of the Markup slice -- it has to do with the implementation.

When the markup slice changed to use an iframe, the contents of the iframe are now populated using the srcdoc attribute: https://github.com/apache/incubator-superset/blob/144f516700b7c6d0d4a0db3d4f53e077f6109cc8/superset/assets/visualizations/markup.js#L28

Unfortunately, srcdoc is not support in the latest IE: https://www.w3schools.com/TAgs/att_iframe_srcdoc.asp

Is it possible to replace the contents of the iframe using jQuery instead of embedding it in the srcdoc attribute? Something similar to the following? https://stackoverflow.com/questions/13214419/alternatives-to-iframe-srcdoc

jaylindquist avatar Oct 19 '17 03:10 jaylindquist

@jaylindquist or you can open a PR adding srcdoc polyfill https://github.com/jugglinmike/srcdoc-polyfill

xrmx avatar Oct 19 '17 07:10 xrmx

@xrmx PR #3702 Opened

jaylindquist avatar Oct 23 '17 12:10 jaylindquist