It is a Javascript based solution for blocking / allowing even 3rd party cookies to comply with GDPR & CCPA.
- Support PC and mobile cookie banner display, responsive
- Lifecycle hooks, giving users the opportunity to add your own code at specific stages
- Multi-lingual, supports EU language
- Support removing unwanted cookies
- Users can customize whether the country complies with CCPA & GDPR
- Support different UA whether to display cookie banner
- Hosted on AWS Cloudfront with edges around the globe for
- Four different blocking methods
Some services insert dynamically created script tags to the HEAD at page load. These can be intercepted and blocked.
Some third party services require you to insert a script tag into your HTML pages. These can be inactivated until the user allowes them.
Some services are not inserted in a SCRIPT tag and are obscured by layers of other code. Thats why this script creates a global wrapper function what you can use to wrap and blovk any JS code.
Finally the local cookies set on your domain can be also filtered by overriding the bowsers COOKIE SET method.
import CookieConsent from 'cookie-consent';
// or
const CookieConsent = require('cookie-consent');
<!-- Specify the version -->
<script src="./cookie-consent.umd.js"></script>
<script>
var CookieConsent = window.CookieConsent;
</script>
var cc = new CookieConsent({
//...options,
});
new CookieConsent({
language: 'en',
});
</script>
cc.on('initialized', (...args) => console.log(args));
cc.on('error', console.error);
cc.on('popupOpened', () => console.log('Popup Open'));
cc.on('popupClosed', () => console.log('Popup Closed'));
cc.on('modalOpened', () => console.log('Modal Open'));
cc.on('modalClosed', () => console.log('Modal Closed'));
cc.on('statusChanged', (...args) => console.log(args));
IE / Edge |
Firefox |
Chrome |
Safari |
iOS Safari |
---|---|---|---|---|
IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
npm t
: Run test suitenpm start
: Runnpm run build
in watch modenpm run test:watch
: Run test suite in interactive watch modenpm run test:prod
: Run linting and generate coveragenpm run build
: Generate bundles and typings, create docsnpm run lint
: Lints codenpm run commit
: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)
Contributions of any kind are welcome!