Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cookieconsent

osano257.3kMIT3.1.1TypeScript support: definitely-typed

Osano cookie consent tool.

readme

Build Status

Cookie Consent is a lightweight JavaScript plugin for alerting users about the use of cookies on your website.

It is designed to help you comply with the hideous EU Cookie Law and not make you want to kill yourself in the process. So we made it fast, free, and relatively painless.

Warning: Phishing attempt

Several users have been emailed with a phishing attempt trying to get them to move the URL they link to from the cdnjs link that is provided on our website as cdnjs is "going away". This is not associated with us and will most likely result in malicious sideloaded code on your website.

Version 3.0

Version 3.0 is a complete rewrite from version 2. The most substantial new features are:

  • the ability to GeoLocate and only show the addon to people in the relevant countries
  • callback hooks for showing/accepting/revoking the banner
  • support for different types of compliance, giving you the flexibility to obey even the strictest cookie laws
  • easy no-fuss themes and customisable styles

Installation

The easiest way to get up and running is to use our wizard.

You can also install this project through npm:

npm install cookieconsent

Or through Bower:

bower install cookieconsent

Or via a jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js"></script>

Documentation

See our full documentation.

Contributing

Feel free to improve the plugin and send us a pull request.

The easiest way to develop is to host the files with a local webserver. e.g.

python -m SimpleHTTPServer

We use Gulp to compile the SCSS and minify the JavaScript. You can run a build with:

gulp build

License

Code released under the MIT licence.

Credits

Cookie Consent v3

  • Alex Morley-Finch (@alexmorleyfinch) - JavaScript
  • Piiu Pilt - JavaScript
  • Oliver Emberton (@oliveremberton) - a couple of lines of CSS, maybe

Cookie Consent v2

  • David Ball (@drball) - CSS / themes
  • Adam Hutchinson (@adjohu) - JavaScript

changelog

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[3.0.2] - 2016-10-17

Added

  • Accessibility
    • :focus effects
    • ARIA rules for accessibility
  • GoogleOff/GoogleOn tags for all content inside the banner. This prevents Google registering CookieConsent text as site content.

[3.0.1] - 2016-09-21

Added

  • Changelog
  • Application written to support:
    • geolocation
    • callback hooks
    • different consent types
    • new and easy to customise stylings

[3.1.0] - 2018-07-17

Added

  • Secure cookies (must use the secure flag) in the cookie option
  • Added a onNoCookieLaw hook
  • Added a few content options like policy and target
  • Added dismissOnWindowClick option (with an ignoreClickFrom) option which blacklists any clicks

Fixed

  • Icons (plus anything else) now allowed in buttons
  • Dont call location service again if user has already chosen their privacy level
  • Revoke option bug (fixed bug where revoke option wouldn't show on refresh after user has picked choice)

Random

  • Lowered console log level from error to warning when location service fails
  • Removed non-standard X-Requested-By header from XxmHttpRequest
  • Removed Maxmind as a default service, but you can still add it yourself (you need to whitelist a domain with maxmind)

Deprecated

  • Removed deprecated FreeGeoIP