CodeByZach / pace

Automatically add a progress bar to your site.
https://codebyzach.github.io/pace/
MIT License
15.65k stars 1.91k forks source link

fix issue HubSpot/pace#261 by localizing key per loop in extendNative #504

Closed a2intl closed 3 years ago

a2intl commented 3 years ago

Currently the XMLHttpRequest.DONE value is getting set to the last-iterated-property-value in extendNative, which, at least in Chrome, is ƒ removeEventListener() { [native code] }, when it should be 4.

We encountered this problem breaking a req.readyState===XMLHttpRequest.DONE condition implemented in the iabtcf-es library by our consent manager, Quantcast Choice, by a user using the Wordpress plugin https://github.com/dcooney/wordpress-ajax-load-more