Open robertknight opened 4 months ago
I filed an upstream issue to see if the tsParticles library can avoid overwriting the DOM Range
object. In the meantime we might need to use some technique other than new Range
to construct ranges to prevent this. Enforcing this would require a lint check. We have a similar existing issue with sites that have broken URL
polyfills on them.
The issue in tsParticles was fixed upstream in the v3.2.2 release, so this means we just need to deal with sites that still reference older versions. https://community.canvaslms.com for example is loading https://cdn.jsdelivr.net/npm/tsparticles-confetti@2.9.3/tsparticles.confetti.bundle.min.js at the time of writing.
Steps to reproduce:
Expected: Annotate/Highlight toolbar appears Actual: Toolbar does not appear. Browser console shows an error:
On this page the
Range
global has been overwritten with a different object which doesn't have the expected API. The problem is caused by the script https://cdn.jsdelivr.net/npm/tsparticles-confetti@2.9.3/tsparticles.confetti.bundle.min.js. Using Chrome devtools to block this script when the page loads prevents the problem from occurring. The issue also occurs on the home page of the tsParticles library - https://particles.js.org.