-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
[Bug]: Modals not showing in Chrome #635
Comments
I have experienced something similar to the described behaviour. I eventually discovered that I had inadvertently "double-loaded" my initialization script. I haven't done too much digging yet (mainly because my symptoms have gone away - for now at least), but it appears the Chrome balks when the same event is registered more than once. |
@JuliaEichler did you follow the guide for angular? You need to make sure the plugin is being loaded on the client side only, when the Please provide a minimal reproduction. Here is an example setup with Angular 17. |
Oh man, I just found out that this error occurs, when VSCode opens a Chrome browser for testing. If I test it directly in my Chrome which has not been opened by VSCode it works. I must have tested your example in the VSCode Chrome too. Sorry for your time and thank your for your hints @nigeldixon and @orestbida! |
Hey @orestbida @JuliaEichler I'm having the same issue. I cannot do automated testing with Chrome with Selenium. Minimal reproduction:
|
@orestbida @JuliaEichler found the issue. In the config of the plugin, when testing, do |
Expected Behavior
Current Behavior
Works fine in Safari, doesn't happen in Chrome.
Cookie-Consent
Modal doesn't show on first page load
Preferences modal doesn't show on button click
A. Button does nothing:
The proposed button that's suggested in the documentation
<button type="button" data-cc="show-preferencesModal">Manage cookie preferences</button>
does nothing at all. No error is emitted either.
B. Calling the preferences modal via typescript:
When calling
CookieConsent.showPreferences()
from the .ts file [CookieService.showSettings() calls CookieConsent.showPreferences();], an error occurs:Steps to reproduce
This happened in previous versions as well. My current setup is as follows:
Angular version 17.1.1
vanilla-cookieconsent version 3.0.0
Browser: Chrome Version 121.0.6167.139
OS: Mac OS 14.3
Doesn't work here either: https://playground.cookieconsent.orestbida.com/
Proposed fix or additional info.
No response
Version
3.0.0
On which browser do you see the issue?
Chrome
The text was updated successfully, but these errors were encountered: