New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cookie-consent-js

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie-consent-js - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

2

package.json
{
"name": "cookie-consent-js",
"version": "1.2.2",
"version": "1.2.3",
"description": "A simple dialog and framework to handle the German and EU law (may 2020) about cookies in a website",

@@ -5,0 +5,0 @@ "main": "src/cookie-consent.js",

# cookie-consent-js
A simple dialog and framework to handle the German and EU law (may 2020) about cookies in a website

@@ -11,6 +12,8 @@

### 1. Install cookie-consent-js in your project with `npm i cookie-consent-js`
### 1. Install cookie-consent-js in your project with `npm install cookie-consent-js`
Alternatively you can download the [git repository](https://github.com/shaack/cookie-consent-js).
### 2. Include `cookie-consent.css`
```html

@@ -23,2 +26,3 @@ <link rel="stylesheet" href="/node_modules/cookie-consent-js/src/cookie-consent.css"/>

### 3. Include `cookie-consent.js`
```html

@@ -30,2 +34,3 @@ <script src="/node_modules/cookie-consent-js/src/cookie-consent.js"></script>

### 4. Initialize the Script
```js

@@ -38,2 +43,3 @@ var cookieConsent = new CookieConsent({privacyPolicyUrl: "/privacy-policy.html"})

### 5. Disable "autoShowModal" in your privacy policy page
```js

@@ -43,5 +49,6 @@ var cookieConsent = new CookieConsent({autoShowModal: false, privacyPolicyUrl: "/privacy-policy.html"})

The settings dialog is linking to the privacy policy. To enable the user to read the policy, you
should disable autoShowModal there.
should disable `autoShowModal` there.
### 6. Enable "Cookie settings" in your service navigation
```html

@@ -63,2 +70,3 @@ <a href="javascript:cookieConsent.reset()">Cookie settings</a>

#### Show the settings dialog again
```js

@@ -71,2 +79,3 @@ cookieConsent.reset()

#### Read the status
```js

@@ -93,2 +102,3 @@ cookieConsent.trackingAllowed()

## Configuration properties
With default values.

@@ -98,4 +108,4 @@

this.props = {
buttonPrimaryClass: "btn btn-primary", // bootstrap: set to "btn btn-primary"
buttonSecondaryClass: "btn btn-outline-primary", // bootstrap: set to "btn btn-secondary"
buttonPrimaryClass: "btn btn-primary", // the "accept all" buttons class, only used for styling
buttonSecondaryClass: "btn btn-secondary", // the "accept necessary" buttons class, only used for styling
privacyPolicyUrl: "privacy-policy.html",

@@ -130,2 +140,3 @@ autoShowModal: true, // disable autoShowModal on the privacy policy page, to make that page readable

### Disable autoShow
You should disable `autoShowModal` in the privacy policy page to make _that_ page readable.

@@ -137,2 +148,3 @@ ```js

## Styling
See `./src/cookie-consent.scss` and overwrite values as you need in your projects stylesheet.

@@ -139,0 +151,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc