klaro-org / klaro-js

Klaro Privacy Manager. An open-source, privacy-friendly & compliant consent manager for your website.
https://klaro.org
Other
1.17k stars 249 forks source link

Do not remove ID attribute from SCRIPT tags #506

Open 2lm opened 3 months ago

2lm commented 3 months ago

When Klaro rewrites script tags of the third-party apps/trackers, it removes id attribute if it is present in the script tag. It causes problems with some apps, for example Zendesk Widget. The tag below

<script id="ze-snippet" type="text/plain" data-type="application/javascript" data-src="https://static.zdassets.com/ekr/snippet.js?key=***" data-name="zendesk"></script>

is being rewritten to:

<script type="text/javascript" src="https://static.zdassets.com/ekr/snippet.js?key=***"></script>

...and stops working, because of the missing id attribute. Is it possible to change this behavior?