You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have integrated your component and tested it in our solution. I quickly ran into the script tag should have the defer attribute set, otherwise Blazor seems to strip out the script tag from head of the server rendered HTML (.NET Core 6 Blazor - server rendered); I am writing this this since it is not clear from your otherwise excellent documentation (but maybe there is another way to handle this I am not aware of).
Once that was done I tested in Microsoft Edge and it seems to work well. I can see the script tag is changed to text/javascript and there is network traffic accessing a Google analytics resource.
However, the same is not true in Firefox (only have 1 add-on installed and it is disabled; also with all blocking turned off in settings). I can observe the cookie is created in Firefox and the script tag is changed when I consent - but the Javascript for the Google analytics tag does not seem to do anything - i.e. no network traffic.
You can check this yourself by just adding this code to the head of the page:
<scripttype="text/plain" data-consent-category="google" defer="defer">alert("google consent detected - but not in Firefox");</script>
In Edge the alert will show; in Firefox it will not.
The text was updated successfully, but these errors were encountered:
I personally wasn't aware that the defer attribute is required, I will add it to the documentation.
I attempted to address the issue you described about Firefox not executing the script tag in 95af524.
The fix is published as a preview package on nuget, please let me know if this resolves the issue for you.
Your changes seems to have fixed the issue! At least I cannot find anything else wrong with it. Much appreciated, since this looks like the nicest cookie consent solution I could find for Blazor. 🙏
If you had a Github donate option, I would donate. Thanks again!
I have integrated your component and tested it in our solution. I quickly ran into the script tag should have the defer attribute set, otherwise Blazor seems to strip out the script tag from head of the server rendered HTML (.NET Core 6 Blazor - server rendered); I am writing this this since it is not clear from your otherwise excellent documentation (but maybe there is another way to handle this I am not aware of).
Once that was done I tested in Microsoft Edge and it seems to work well. I can see the script tag is changed to text/javascript and there is network traffic accessing a Google analytics resource.
However, the same is not true in Firefox (only have 1 add-on installed and it is disabled; also with all blocking turned off in settings). I can observe the cookie is created in Firefox and the script tag is changed when I consent - but the Javascript for the Google analytics tag does not seem to do anything - i.e. no network traffic.
You can check this yourself by just adding this code to the head of the page:
In Edge the alert will show; in Firefox it will not.
The text was updated successfully, but these errors were encountered: