Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@getdesigned-vienna/cookie-consent

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getdesigned-vienna/cookie-consent - npm Package Compare versions

Comparing version 1.1.3 to 1.1.5

39

getdesigned-cookie-consent.js

@@ -1,3 +0,4 @@

function GdCookieConsent(debug = false) {
function GdCookieConsent(debug = false, expiration = 365) {
this.debugMode = debug;
this.expiration = expiration;
this.$gdcc = null; // will point to gdcc wrapper soon

@@ -110,4 +111,20 @@ this.config = []

this.modifySrcAndScriptType = function (id, status) {
var optIn = '.gdcc-optin[data-gdcc-cookie="' + id + '"][data-gdcc-src], .gdcc-optin-' + id + '[data-gdcc-src], [data-gdcc-selector="gdcc-optin-' + id + '"][data-gdcc-src]';
var optOut = '.gdcc-optout[data-gdcc-cookie="' + id + '"][data-gdcc-src], .gdcc-optout-' + id + '[data-gdcc-src], [data-gdcc-selector="gdcc-optout-' + id + '"][data-gdcc-src]';
var optIn = '' +
'.gdcc-optin[data-gdcc-cookie="' + id + '"][data-gdcc-src], ' +
'.gdcc-optin[data-gdcc-cookie="' + id + '"][data-gdcc-inline], ' +
'.gdcc-optin-' + id + '[data-gdcc-src], ' +
'.gdcc-optin-' + id + '[data-gdcc-inline], ' +
'[data-gdcc-selector="gdcc-optin-' + id + '"][data-gdcc-src], ' +
'[data-gdcc-selector="gdcc-optin-' + id + '"][data-gdcc-inline]'
;
var optOut = '' +
'.gdcc-optout[data-gdcc-cookie="' + id + '"][data-gdcc-src], ' +
'.gdcc-optout[data-gdcc-cookie="' + id + '"][data-gdcc-inline], ' +
'.gdcc-optout-' + id + '[data-gdcc-src], ' +
'.gdcc-optout-' + id + '[data-gdcc-inline], ' +
'[data-gdcc-selector="gdcc-optout-' + id + '"][data-gdcc-src],' +
'[data-gdcc-selector="gdcc-optout-' + id + '"][data-gdcc-inline]'
;
var that = this;

@@ -129,4 +146,11 @@

$this.attr('type', 'text/javascript');
if (typeof $this.attr('data-gdcc-inline') !== typeof undefined && $this.attr('data-gdcc-inline') !== false) {
$('head').append($this[0].outerHTML);
$this.remove();
}
}
$this.attr('src', $this.attr('data-gdcc-src'));
if (typeof $this.attr('data-gdcc-src') !== typeof undefined && $this.attr('data-gdcc-src') !== false) {
$this.attr('src', $this.attr('data-gdcc-src'));
}
});

@@ -143,3 +167,6 @@

}
$this.removeAttr('src');
if (typeof $this.attr('src') !== typeof undefined && $this.attr('src') !== false) {
$this.removeAttr('src');
}
});

@@ -220,3 +247,3 @@ }

var json = JSON.stringify(context.config);
cookie('gdcc-cookie-consent-settings', json);
cookie('gdcc-cookie-consent-settings', json, this.expiration);
this.log(JSON.parse(json));

@@ -223,0 +250,0 @@ }

2

package.json
{
"name": "@getdesigned-vienna/cookie-consent",
"version": "1.1.3",
"version": "1.1.5",
"description": "Cookie Consent completely configured via HTML",

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

@@ -89,3 +89,9 @@ Getdesigned Cookie Consent (GDCC)

* The "type" attribute normally set to "text/css" and "type=text/javascript" should be set to "text/plain" instead. GDCC will take care.
* Additionally, you can use inline scripts. Therefore, use the "data-gdcc-inline" attribute
<script data-gdcc-inline data-gdcc-selector="gdcc-optin-googleanalytics" type="text/plain">
// Insert your code here
</script>
## Missing cookie permissions / i18n

@@ -92,0 +98,0 @@ * When the user clicks on an optout element (e.g. a note that YouTube is currently disabled), it is possible to ask the user, if she/he wants to proceed and enable the corresponding cookie category.

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