-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not polute global JS namespace #182
Comments
The easiest solution probably is to wrap the whole file into an Immediately Invoked Function Expression to have everything in its own scope. |
This should only affect dev environments with Currently, I consider this a minor issue as it doesn’t effect production sites. However, it’s already planned to refactor the JavaScript in version 2.0 since it’s a breaking change. So I added this to the list of #67. Thank you for pointing out the problem. 🤗 |
Oh, yeah, of course. 🤦♂️ Good morning, sorry for the noise. 😀 |
No problem, I didn’t have it on the list. Better this way than another. 🙂 |
Bug/Problem
There currently are multiple JS functions defined in the global namespace. To make things worse they also have very generic names. They are also taken from stackoverflow which makes it even more likely to have collisions with other peoples code.
get_cookie
htmlentities_decode
remove_cookie
set_cookie
embed-privacy/assets/js/embed-privacy.js
Lines 286 to 346 in 2cf319a
Steps to reproduce
get_ cookie
to see that they are defined in the global namespace.Version
1.7.2
Link
No response
Environment info
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: