Socket
Socket
Sign inDemoInstall

vanilla-cookieconsent

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-cookieconsent - npm Package Compare versions

Comparing version 2.7.0-rc1 to 2.7.0-rc2

18

dist/cookieconsent.js
/*
CookieConsent v2.7.0-rc1
CookieConsent v2.7.0-rc2
https://www.github.com/orestbida/cookieconsent

@@ -32,9 +32,9 @@ Author Orest Bida

a.revision&&(f.m=a.revision),ya=!0);!0===a.autoclear_cookies&&(f.s=!0);!0===a.use_rfc_cookie&&(f.j=!0);!0===a.hide_from_bots&&(La=navigator&&(navigator.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(navigator.userAgent)||navigator.F));f.C=!0===a.page_scripts;f.D=!1!==a.page_scripts_order;"browser"===a.auto_language||!0===a.auto_language?f.l="browser":"document"===a.auto_language&&(f.l="document");var b=a.languages;a=a.current_lang;"browser"===f.l?(a=navigator.language||navigator.browserLanguage,
2<a.length&&(a=a[0]+a[1]),b=Ca(a.toLowerCase(),b)):b="document"===f.l?Ca(document.documentElement.lang,b):"string"===typeof a?f.g=Ca(a,b):f.g;f.g=b}var f={g:"en",l:null,u:!0,i:"cc_cookie",v:182,h:window.location.hostname,A:"/",B:"Lax",j:!1,s:!0,m:0,o:"data-cookiecategory"},k={},t={},S=!1,T=!1,ia=!1,ta=!1,ha=!1,v,V,y,ua,va,W=!0,ya=!1,D=null,La=!1,pa,Da,Ba=[],da=[],P=[],N=[],Aa=[],aa=document.documentElement,M,x,J,O,wa,xa,Ha="",ja;k.allowedCategory=function(a){return-1<I(JSON.parse(fa(f.i,"one",!0)||
"{}").level||[],a)};k.run=function(a){if(!document.getElementById("cc_div")&&(Ta(a),!La&&(t=JSON.parse(fa(f.i,"one",!0)||"{}"),T=void 0!==t.level,D=void 0!==t.data?t.data:null,W="number"===typeof a.revision?T?-1<a.revision?t.revision===f.m:!0:!0:!0,S=!T||!W,Ra(!S,a),Pa(a.theme_css,function(){Ka();Ga(a.gui_options);Sa();f.u&&S&&k.show(a.delay||0);setTimeout(function(){G(M,"c--anim")},30);setTimeout(function(){Oa()},100)}),T&&W))){var b="boolean"===typeof t.rfc_cookie;if(!b||b&&t.rfc_cookie!==f.j)t.rfc_cookie=
f.j,ra(f.i,JSON.stringify(t));sa();if("function"===typeof a.onAccept)a.onAccept(t)}};k.showSettings=function(a){setTimeout(function(){G(aa,"show--settings");J.setAttribute("aria-hidden","false");ta=!0;setTimeout(function(){ia?Da=document.activeElement:pa=document.activeElement;0!==da.length&&(da[3]?da[3].focus():da[0].focus(),v=da)},200)},0<a?a:0)};k.set=function(a,b){switch(a){case "data":a=b.value;var c=!1;if("update"===b.mode)if(D=k.get("data"),(b=typeof D===typeof a)&&"object"===typeof D){!D&&
(D={});for(var d in a)D[d]!==a[d]&&(D[d]=a[d],c=!0)}else!b&&D||D===a||(D=a,c=!0);else D=a,c=!0;c&&(t.data=D,ra(f.i,JSON.stringify(t)));return c;case "revision":return d=b.value,a=b.prompt_consent,b=b.message,M&&"number"===typeof d&&t.revision!==d?(ya=!0,Ha=b,W=!1,f.m=d,!0===a?(xa(wa),Ga(wa.gui_options,!0),Ka(),k.show()):k.accept(),b=!0):b=!1,b;default:return!1}};k.get=function(a,b){return JSON.parse(fa(b||f.i,"one",!0)||"{}")[a]};k.getConfig=function(a){return f[a]};k.loadScript=function(a,b,c){var d=
"function"===typeof b;if(document.querySelector('script[src="'+a+'"]'))d&&b();else{var e=g("script");if(c&&0<c.length)for(var h=0;h<c.length;++h)c[h]&&e.setAttribute(c[h].name,c[h].value);d&&(e.readyState?e.onreadystatechange=function(){if("loaded"===e.readyState||"complete"===e.readyState)e.onreadystatechange=null,b()}:e.onload=b);e.src=a;(document.head?document.head:document.getElementsByTagName("head")[0]).appendChild(e)}};k.updateScripts=function(){sa()};k.show=function(a){S&&setTimeout(function(){G(aa,
"show--consent");x.setAttribute("aria-hidden","false");ia=!0;setTimeout(function(){pa=document.activeElement;v=Ba},200)},0<a?a:0)};k.hide=function(){S&&(qa(aa,"show--consent"),x.setAttribute("aria-hidden","true"),ia=!1,setTimeout(function(){pa.focus();v=null},200))};k.hideSettings=function(){qa(aa,"show--settings");ta=!1;J.setAttribute("aria-hidden","true");setTimeout(function(){ia?(Da&&Da.focus(),v=Ba):(pa.focus(),v=null);ha=!1},200)};k.accept=function(a,b){function c(){for(var h=document.querySelectorAll(".c-tgl")||
[],m=[],l=0;l<h.length;l++)h[l].checked&&m.push(h[l].value);return m}a=a||void 0;var d=b||[];b=[];if(a)if("object"===typeof a&&"number"===typeof a.length)for(var e=0;e<a.length;e++)-1!==I(N,a[e])&&b.push(a[e]);else"string"===typeof a&&("all"===a?b=N.slice():-1!==I(N,a)&&b.push(a));else b=c();if(1<=d.length)for(e=0;e<d.length;e++)b=b.filter(function(h){return h!==d[e]});for(e=0;e<N.length;e++)!0===Aa[e]&&-1===I(b,N[e])&&b.push(N[e]);Qa(b)};k.eraseCookies=function(a,b,c){var d=[];c=c?[c,"."+c]:[f.h,
"."+f.h];if("object"===typeof a&&0<a.length)for(var e=0;e<a.length;e++)this.validCookie(a[e])&&d.push(a[e]);else this.validCookie(a)&&d.push(a);Fa(d,b,c)};k.validCookie=function(a){return""!==fa(a,"one",!0)};return k}"function"!==typeof window.initCookieConsent&&(window.initCookieConsent=Ma)})();
2<a.length&&(a=a[0]+a[1]),b=Ca(a.toLowerCase(),b)):b="document"===f.l?Ca(document.documentElement.lang,b):"string"===typeof a?f.g=Ca(a,b):f.g;f.g=b}var f={current_lang:"en",auto_language:null,autorun:!0,cookie_name:"cc_cookie",cookie_expiration:182,cookie_domain:window.location.hostname,cookie_path:"/",cookie_same_site:"Lax",use_rfc_cookie:!1,autoclear_cookies:!0,revision:0,script_selector:"data-cookiecategory"},k={},t={},S=!1,T=!1,ia=!1,ta=!1,ha=!1,v,V,y,ua,va,W=!0,ya=!1,D=null,La=!1,pa,Da,Ba=[],
da=[],P=[],N=[],Aa=[],aa=document.documentElement,M,x,J,O,wa,xa,Ha="",ja;k.allowedCategory=function(a){return-1<I(JSON.parse(fa(f.i,"one",!0)||"{}").level||[],a)};k.run=function(a){if(!document.getElementById("cc_div")&&(Ta(a),!La&&(t=JSON.parse(fa(f.i,"one",!0)||"{}"),T=void 0!==t.level,D=void 0!==t.data?t.data:null,W="number"===typeof a.revision?T?-1<a.revision?t.revision===f.m:!0:!0:!0,S=!T||!W,Ra(!S,a),Pa(a.theme_css,function(){Ka();Ga(a.gui_options);Sa();f.u&&S&&k.show(a.delay||0);setTimeout(function(){G(M,
"c--anim")},30);setTimeout(function(){Oa()},100)}),T&&W))){var b="boolean"===typeof t.rfc_cookie;if(!b||b&&t.rfc_cookie!==f.j)t.rfc_cookie=f.j,ra(f.i,JSON.stringify(t));sa();if("function"===typeof a.onAccept)a.onAccept(t)}};k.showSettings=function(a){setTimeout(function(){G(aa,"show--settings");J.setAttribute("aria-hidden","false");ta=!0;setTimeout(function(){ia?Da=document.activeElement:pa=document.activeElement;0!==da.length&&(da[3]?da[3].focus():da[0].focus(),v=da)},200)},0<a?a:0)};k.set=function(a,
b){switch(a){case "data":a=b.value;var c=!1;if("update"===b.mode)if(D=k.get("data"),(b=typeof D===typeof a)&&"object"===typeof D){!D&&(D={});for(var d in a)D[d]!==a[d]&&(D[d]=a[d],c=!0)}else!b&&D||D===a||(D=a,c=!0);else D=a,c=!0;c&&(t.data=D,ra(f.i,JSON.stringify(t)));return c;case "revision":return d=b.value,a=b.prompt_consent,b=b.message,M&&"number"===typeof d&&t.revision!==d?(ya=!0,Ha=b,W=!1,f.m=d,!0===a?(xa(wa),Ga(wa.gui_options,!0),Ka(),k.show()):k.accept(),b=!0):b=!1,b;default:return!1}};k.get=
function(a,b){return JSON.parse(fa(b||f.i,"one",!0)||"{}")[a]};k.getConfig=function(a){return f[a]};k.loadScript=function(a,b,c){var d="function"===typeof b;if(document.querySelector('script[src="'+a+'"]'))d&&b();else{var e=g("script");if(c&&0<c.length)for(var h=0;h<c.length;++h)c[h]&&e.setAttribute(c[h].name,c[h].value);d&&(e.readyState?e.onreadystatechange=function(){if("loaded"===e.readyState||"complete"===e.readyState)e.onreadystatechange=null,b()}:e.onload=b);e.src=a;(document.head?document.head:
document.getElementsByTagName("head")[0]).appendChild(e)}};k.updateScripts=function(){sa()};k.show=function(a){S&&setTimeout(function(){G(aa,"show--consent");x.setAttribute("aria-hidden","false");ia=!0;setTimeout(function(){pa=document.activeElement;v=Ba},200)},0<a?a:0)};k.hide=function(){S&&(qa(aa,"show--consent"),x.setAttribute("aria-hidden","true"),ia=!1,setTimeout(function(){pa.focus();v=null},200))};k.hideSettings=function(){qa(aa,"show--settings");ta=!1;J.setAttribute("aria-hidden","true");
setTimeout(function(){ia?(Da&&Da.focus(),v=Ba):(pa.focus(),v=null);ha=!1},200)};k.accept=function(a,b){function c(){for(var h=document.querySelectorAll(".c-tgl")||[],m=[],l=0;l<h.length;l++)h[l].checked&&m.push(h[l].value);return m}a=a||void 0;var d=b||[];b=[];if(a)if("object"===typeof a&&"number"===typeof a.length)for(var e=0;e<a.length;e++)-1!==I(N,a[e])&&b.push(a[e]);else"string"===typeof a&&("all"===a?b=N.slice():-1!==I(N,a)&&b.push(a));else b=c();if(1<=d.length)for(e=0;e<d.length;e++)b=b.filter(function(h){return h!==
d[e]});for(e=0;e<N.length;e++)!0===Aa[e]&&-1===I(b,N[e])&&b.push(N[e]);Qa(b)};k.eraseCookies=function(a,b,c){var d=[];c=c?[c,"."+c]:[f.h,"."+f.h];if("object"===typeof a&&0<a.length)for(var e=0;e<a.length;e++)this.validCookie(a[e])&&d.push(a[e]);else this.validCookie(a)&&d.push(a);Fa(d,b,c)};k.validCookie=function(a){return""!==fa(a,"one",!0)};return k}"function"!==typeof window.initCookieConsent&&(window.initCookieConsent=Ma)})();
{
"name": "vanilla-cookieconsent",
"version": "2.7.0-rc1",
"version": "2.7.0-rc2",
"description": "🍪 Simple cross-browser cookie-consent plugin written in vanilla js.",

@@ -5,0 +5,0 @@ "main": "dist/cookieconsent.js",

Sorry, the diff of this file is too big to display

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