---
title: Supporting “I don’t care about cookies”
description: It all started one day when my boss turned to me and said, the legal
  team have said we need to ask a person before our websites can start using non-essential
  cookies. So we started the cookie-policy project which is written in vanilla JavaScript
  with accompanying styling and the back-end implemented via Google Tag Manager.  […]
url: https://canonical.com/blog/supporting-i-dont-care-about-cookies?format=md
---

1. [Blog](https://canonical.com/blog)
2. Article

---

[Anthony Dillon](https://canonical.com/blog/author/ya-bo-ng "More about Anthony Dillon")

19 February 2021

# Supporting “I don’t care about cookies”

[Design](https://canonical.com/blog/tag/design)

---

Share the article

It all started one day when my boss turned to me and said, the legal team have said we need to ask a person before our websites can start using non-essential cookies. So we started the [cookie-policy project](https://github.com/canonical-web-and-design/cookie-policy) which is written in vanilla JavaScript with accompanying styling and the back-end implemented via Google Tag Manager.

The cookie-policy project displays a modal to each first-time visitor to manage which cookies they would like to accept. We have rolled out successfully across [over 30 of our sites](https://github.com/search?q=topic%3Awebsite+org%3Acanonical-web-and-design&type=Repositories).

Recently we [received an issue](https://github.com/canonical-web-and-design/charmhub.io/issues/809) that there was no way to scroll on our site if you were using a popular browser extension named [I don’t care about cookies](https://www.i-dont-care-about-cookies.eu/). The cookie policy script added a class to the body of the site to lock scrolling as it was expecting the cookie management modal to be present. The plugin has a range of selectors targeting known cookie notification elements and hides the cookie modal making it impossible for users to remove the scroll lock.

### How to support the extension

Here is a subset of the CSS injected into the site by the plugin. As you can see `.cookie-policy` is targeted and happens to be the container class used [by our cookie-policy](https://www.npmjs.com/package/@canonical/cookie-policy).

```
#stickyCookieBar,
.cookiebar-bar:not(body):not(html),
#sliding-popup,
#cookie_bar_top,
#cookielaw:not(.modal),
[ … ]
.cookie-policy:not(body):not(html),
[ … ]
#cookiebnr,
#cookieWarning, {
    display: none !important;
    ...
}
```

There are a few body classes but they have been kept to a minimum for good reason.

This isn’t what we want to happen and we believe it’s important to respect the wishes of our users so we want to support this extension. Therefore we [removed the scroll lock](https://github.com/canonical-web-and-design/cookie-policy/pull/115) after the cookie management modal appeared as there was no way to identify if the modal was being hidden via this extension.

So if you have written a cookie policy widget for your site or application try and support the extension by using [one of the supported selectors](https://gist.github.com/anthonydillon/b77351b8266a777dc5ef8489d5f7df45) and also try and keep it self contained within that element to limit issues such as we expereinced.

[Get in touch

Interested in running Ubuntu in your organization?](https://ubuntu.com/about/contact-us/form)

## Sign up for our newsletter

Get the latest Canonical news and updates in your inbox.

Work email:

\*I agree to receive information about Canonical's
products and services.

By submitting this form, I confirm that I have read and agree to [Canonical's Privacy Policy](https://canonical.com/legal/dataprivacy).

Sign up

## Share on

---

## Related posts

[### Challenges designers face in open source (and how to fix them)](https://canonical.com/blog/challenges-designers-face-in-open-source-and-how-to-fix-them)

Open source powers up to 90% of modern software, yet many projects lack usability. Canonical’s Design team surveyed 115 cross-functional professionals to uncover the 4 core...

[Kola Ojoodide](https://canonical.com/blog/author/kola-ojoodide)

26 June 2026

[### Why web engineering is great](https://canonical.com/blog/why-web-engineering-is-great)

Hi, I’m Johann! I’m an engineering manager in Canonical’s web team. For the larger part of my 15 years of work experience as engineer, I’ve been working in web development....

[Johann Wolf](https://canonical.com/blog/author/johannwolf)

27 April 2026

[### Canonical’s recipe for High Performance Computing](https://canonical.com/blog/canonicals-recipe-for-high-performance-computing)

In essence, High Performance Computing (HPC) is quite simple. Speed and scale. In practice, the concept is quite complex and hard to achieve. It is not dissimilar to what...

[Igor Ljubuncic](https://canonical.com/blog/author/igorljubuncic)

24 January 2024

[### Web team – hack week 2023](https://canonical.com/blog/web-team-hack-week-2023)

Today, around 96% of software projects utilize open source in some way. The web team here at Canonical is passionate about Open source. We lead with an open-by-default approach...

[Anthony Dillon](https://canonical.com/blog/author/ya-bo-ng)

25 October 2023
