File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
apps/blog/src/app/providers/tracking Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ export const cookieConsentConfig = {
2727 cookie : {
2828 name : 'cc_cookie_al' ,
2929 } ,
30+ onModalShow : ( ) => {
31+ const ccEl = document . getElementById ( 'cc-main' ) ;
32+ // Check if the cookie consent dialog has been hidden by injected styles from an external extension (e.g., "I don't care about cookies").
33+ // To respect this and avoid issues with the `disablePageInteraction` flag, we manually remove the overlay that blocks page interaction.
34+ if ( ccEl && window . getComputedStyle ( ccEl ) . display === 'none' ) {
35+ // Reference: https://github.com/orestbida/cookieconsent/blob/e6279509aab5b96be198297b0283b321ad76b0a9/src/utils/constants.js#L8C50-L8C70
36+ document . documentElement . classList . remove ( 'disable--interaction' ) ;
37+ }
38+ } ,
3039 onConsent : ( ) => {
3140 window . dataLayer . push ( { event : 'consent_update' } ) ;
3241 window . dispatchEvent ( new CustomEvent ( 'ptupdate' ) ) ;
You can’t perform that action at this time.
0 commit comments