Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
cookie-consent-js
Advanced tools
A simple dialog and framework to handle the German and EU law (may 2020) about cookies in a website
A simple dialog and framework to handle the German and EU law (may 2020) about cookies in a website
<link rel="stylesheet" href="./src/cookie-consent.css"/>
<script src="./src/cookie-consent.js"></script>
var cookieConsent = new CookieConsent(props)
In props
you should at least define privacyPolicyUrl
.
See below "Configuration properties".
cookieConsent.reset()
Use this to allow the user to reconfigure the cookie settings, for example in your service navigation as "cookie settings".
cookieConsent.isTrackingCookieAllowed()
Use this function to disable tracking. Suround for example the Analytics code with
if(cookieConsent.isTrackingCookieAllowed()) {
// Google Analytics code and other tracking code
}
With default values.
this.props = {
buttonPrimaryClass: "button button-accept-all", // bootstrap: set to "btn btn-primary"
buttonSecondaryClass: "button button-accept-necessary", // bootstrap: set to "btn btn-secondary"
privacyPolicyUrl: "privacy-policy.html",
autoShowModal: true, // disable autoShowModal on the privacy policy page, to make this page readable
lang: navigator.language, // the language, in which the modal is shown
content: { // the content in all needed languages
de: {
title: "Cookie-Einstellungen",
body: "Wir nutzen Cookies, um Inhalte zu personalisieren und die Zugriffe auf unsere Website zu analysieren. " +
"Sie können wählen, ob Sie nur für die Funktion der Website notwendige Cookies akzeptieren oder auch " +
"Tracking-Cookies zulassen möchten. Weitere Informationen finden Sie in unserer --privacy-policy--.",
privacyPolicy: "Datenschutzerklärung",
buttonAcceptAll: "Alle Cookies akzeptieren",
buttonAcceptTechnical: "Nur technisch notwendige Cookies akzeptieren"
},
en: {
title: "Cookie settings",
body: "We use cookies to personalize content and analyze access to our website. " +
"You can choose whether you only accept cookies that are necessary for the functioning of the website " +
"or whether you also want to allow tracking cookies. For more information, please refer to our --privacy-policy--.",
privacyPolicy: "privacy policy",
buttonAcceptAll: "Accept all cookies",
buttonAcceptTechnical: "Only accept technically necessary cookies"
}
},
modalId: "cookieConsentModal", // this may not be changed
cookieName: "cookie-consent-accept-all" // this may not be changed
}
You should disable autoShowModal
in the privacy policy page to make this page readable.
var cookieConsent = new CookieConsent({linkPrivacyPolicy: "privacy-policy.html", autoShowModal: false})
See ./src/cookie-consent.scss
and overwrite values as you need in your projects stylesheet.
FAQs
A simple dialog and framework to handle the EU law (as written by EuGH, 1.10.2019 – C-673/17) about cookies in a website.
The npm package cookie-consent-js receives a total of 257 weekly downloads. As such, cookie-consent-js popularity was classified as not popular.
We found that cookie-consent-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.