visjs / vis-timeline

📅 Create a fully customizable, interactive timelines and 2d-graphs with items and ranges.
https://visjs.github.io/vis-timeline/
Other
1.88k stars 317 forks source link

CSP: Timeline violates CSP in regenerator/runtime.js #466

Closed melloware closed 4 years ago

melloware commented 4 years ago

Timeline is failing with Content Security Policy enabled for 2 reasons.

  1. You are using "use strict" mode in your dist.

  2. See this comment in Regenerator dependency:

https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js#L716-L728

Need to remove use strict from Babel: https://stackoverflow.com/questions/33821312/how-to-remove-global-use-strict-added-by-babel

Looks like it needs to fixed in vis-dev-utils: https://github.com/visjs/vis-dev-utils/blob/master/babel-preset/index.js

melloware commented 4 years ago

I think this is fixed now with this PR: https://github.com/visjs/vis-timeline/pull/483

yotamberk commented 4 years ago

Indeed.