elleracompany / craft-cookie-consent

GDPR-Compliant cookie consent banner for Craft CMS
Other
6 stars 5 forks source link

Use DOMContentLoaded event instead of load event #12

Closed tegandbiscuits closed 4 years ago

tegandbiscuits commented 4 years ago

Using the window.load event waits until the page is finished loading before running. This causes an issue where if someone accepts cookies while an asset is still loading, they will be taken to a different page that just says true.

Using the DOMContentLoaded should accomplish what the load event was doing, but in a way that makes it not depend on having fully loaded assets.

I believe this also resolves issue #11