68publishers / cookie-consent

:cookie: Cookie-consent widget with GTM, GCM & CMP integration
MIT License
118 stars 28 forks source link

Fix Cmp integration #74

Closed xVANKO closed 8 months ago

xVANKO commented 8 months ago

for in iterates over object properties (and prototype chain too) and should not be used to iterate over arrays.

Example: line 90 will make prototype property "remove" child of an array:

image image

Tested on Brave Browser - without this fix, I cannot display data from CMP: image

tg666 commented 8 months ago

Hi, really good point. We generally don't use prototyping on generic/native objects in applications, so we've never had this bug.

I'll have to go through the source code, as it uses this type of iteration in multiple places. I'll get to it tomorrow or over the weekend.