highcharts / highcharts-editor

https://www.highcharts.com/products/highcharts-editor
Other
250 stars 96 forks source link

Detection of scripts checks only scripts of CDN #150

Closed sbt2486 closed 6 years ago

sbt2486 commented 6 years ago

related_part_of_highed.chartpreview.txt This happens in getEmbeddableJavaScript() and prevents me from using the library because I'm adding the highcharts files from my own server. The problematic code is the attached and part of highed.chartpreview.js.

The main problem is the code checks for existing scripts only against the CDN urls so doesn't include locally included scripts and thus the CDN scripts get added again, even though they were added on the local server already.

The whole thing here seems rather hacky. How about at least using feature detection instead of parsing and checking for the existing CDN urls in script tags?

cvasseng commented 6 years ago

In the latest version, you can set the global option includeCDNInExport to skip including CDN scripts: highed.option('includeCDNInExport', false).