Blockmode "auto" breaks Drupal javascript

Created on 31 March 2025, 5 days ago

Problem/Motivation

When using Cookiebot with auto blocking enabled javascript can break in certain situations. When Cookiebot scans a javascript file that may potentially set a cookie the file will be blocked. This is especially a problem when used together with JS aggregation.

Steps to reproduce

  1. Enable Cookiebot auto blocking
  2. Enable Javascript aggregaiton
  3. Create a custom form that uses the Drupal states API
  4. Test the form in Chrome

Proposed resolution

While autoblocking is still a very useful feature it shouldn't break javascript, even if it can potentially set cookies.

The keep autoblocking enabled I'm proposing to exclude all javascript generated by Drupal from being tracked. There are more advanced solutions like https://www.drupal.org/project/cookie_blocking_libraries that allow you to configure every single library, but this doesn't work with aggregation.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium klaasvw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024