Skip to content

Displaying the cookie consent view after DOMContentLoaded #89

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nlukic97
Copy link

@nlukic97 nlukic97 commented Jul 28, 2025

Solves #47 and #63.

Added DOMContentLoaded to ensure the cookie consent view is shown after the DOM is fully loaded.

I noticed the merged pull request #86 which ensures window.LaravelCookieConsent is initialized after DOMContentLoaded. With this said, it is still possible for the cookie consent box to be shown before window.LaravelCookieConsent is initialized, which would result in undefined errors when clicking on the cookie consent buttons. This PR solves this scenario.

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.

1 participant