Skip to content

Conversation

@MarcPorciuncula
Copy link

@MarcPorciuncula MarcPorciuncula commented Oct 5, 2021

Hey there, I'm trying to load amplitude-js into a browser context that also has some third party scripts that we can't control. One such script is modifying the Array prototype and adding additional enumerable properties.

These additional properties are picked up by the for-in loop in enumerize and result in the evaluation of toUpperCase on potentially non-string values, causing a crash.

Replacing the for-in loop with a counter based for loop would make this safer.

@GalvinGao
Copy link

GalvinGao commented Oct 22, 2021

Please merge this PR as this problem has already causing some of our user using a lower version of Android Webview with our App to crash due to an issue described in amplitude/Amplitude-JavaScript#435. In-house solution was to create a patch using patch-package. See the issue for potential fixes when this PR is not yet being merged.

@chrskrchr
Copy link

@qingzhuozhen - could you please review this PR? or refresh the fork from upstream? This bug has been addressed in the upstream ua-parser-js lib:

faisalman#547

@seanparmelee
Copy link

Hey @jooohhn, any chance you can help move this one along?

Copy link

@jooohhn jooohhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@jooohhn jooohhn merged commit 59cc613 into amplitude:master Nov 24, 2021
@chrskrchr
Copy link

chrskrchr commented Nov 29, 2021

@jooohhn - any ETA on when we could expect for this to be pulled into the Amplitude-JavaScript project to address faisalman#435?

Ryan-Haines pushed a commit to Anatomy-Financial/ua-parser-js-1 that referenced this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants