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
100kB+ seemed too heavy for a cookie popup so I wrote this. It's currently < 4kB gz/btr, including CSS. It's designed to be as small as possible with an adequate featureset for basic website cookie consent.
6
+
100kB+ seemed too heavy for a cookie popup so I wrote this. It's currently < 4kB gz/br, including CSS. It's designed to be as small as possible with an adequate featureset for basic website cookie consent.
7
7
8
8
- Stores consent in `localStorage`, exposes in `window.Consent` and through custom events fired on `document`
- Cookies/localstorage items removed on rejection/invalidation, if cookie details added
10
+
- Optionally shows user specific cookie (or localStorage item) details
11
+
- Cookies/localstorage items removed on rejection/invalidation, if cookie details added
12
12
- Fully customizable strings so you can serve localized strings if you want
13
13
- Overridable localStorage key, consent global
14
14
- Simple flat configuration object
15
15
- Injects scripts when granular consent is granted (`<script data-consent="analytics" type="text/plain" src="..."></script>`)
16
-
- Injects embedded `<script>` from script tags with `src` properties on onload (tidier markup)
16
+
- Injects embedded 'after' `<script>` from script tags with `src` properties on onload (= less markup)
17
17
- Mobile-first
18
18
- Browser support (targeted via `browserlist` in `package.json` - `>= 2%, last 2 years`):
19
19
- Chrome 105+,
20
20
- Edge 105+
21
21
- Safari 15.4+
22
22
- Firefox 121+
23
-
-Samsung browser 20+
24
-
-run `npm run build report` and view `index.html`to compatibility table. If you need a version to work in older browsers, update the browserlist version and modify the CSS
23
+
-see [CSS Feature Compatibility](https://replete.github.io/biscuitman/#browser-support) (uses `cssreport.json` generated by `npm run report`)
24
+
-If you need a version to work in older browsers it's possible but requires updating the `browserlist` string in `package.json`, and then rewriting CSS to remove unsupported features, e.g. `:has()`. If this is really important open an issue and we can look at making it more compatible by default.
25
25
- 'show more' functionality for long disclaimer text
26
26
- include optional link in any text
27
27
- CSS classes on `<html>` element for consents
@@ -38,10 +38,10 @@
38
38
- add 'data-consent' property with consent section name (e.g. analytics, functional, performance)
-`biscuitman:inject` => `{el: $Element, parent?: $Element, id?: 'script-id', time: 1718914784624}` script injected to DOM. if parent exists, it's a new tag inserted after a `src` script loaded which also had text content (a 'dependent' script = tidier convenient markup)
-`biscuitman:revoke` => `{section: 'analytics', time: 1718914784624}` returns section that was revoked if updated consent changed from true to false
168
168
-`biscuitman:update` => `{data: {...currentConsentObject}, time: 1718914784624}` returns current consent object and time
169
169
-`biscuitman:delete` => `{localStorage|cookie: 'cookieName', time: 1718914784624}` fires when consent is rejected or invalidated and cookies/localStorage entries are deleted
0 commit comments