68publishers-cookie-consent
Advanced tools
Comparing version 0.4.8-beta.1 to 0.4.8-beta.2
{ | ||
"name": "68publishers-cookie-consent", | ||
"version": "0.4.8-beta.1", | ||
"version": "0.4.8-beta.2", | ||
"description": "Cookie consent wrapper based on orestbida/cookieconsent with GTM integration.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://www.68publishers.io/", |
@@ -72,2 +72,24 @@ 'use strict'; | ||
get consentCookieData() { | ||
const cookieName = this._config.pluginOptions.cookie_name; | ||
let cookieValue = document.cookie.match("(^|;)\\s*" + cookieName + "\\s*=\\s*([^;]+)"); | ||
cookieValue = cookieValue ? cookieValue.pop() : null; | ||
if (null === cookieValue) { | ||
return null; | ||
} | ||
try{ | ||
cookieValue = JSON.parse(cookieValue) | ||
} catch (e) { | ||
try { | ||
cookieValue = JSON.parse(decodeURIComponent(cookieValue)) | ||
} catch (e) { | ||
cookieValue = null; | ||
} | ||
} | ||
return cookieValue; | ||
} | ||
setStaticUserIdentity(id) { | ||
@@ -74,0 +96,0 @@ this._user = this.user.withStaticIdentity(id); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
301257
2038