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

fer-cookie-bot

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fer-cookie-bot - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

14

js/fer-cookiebot.js

@@ -24,2 +24,6 @@ /* VERIFY CONSENT https://tagassistant.google.com */

gtag() {
dataLayer.push(arguments);
}
loadGTagScript() {

@@ -31,5 +35,4 @@ const script = document.createElement('script');

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', this.googleTagId);
this.gtag('js', new Date());
this.gtag('config', this.googleTagId);
}

@@ -68,3 +71,3 @@

initializeDefaultConsentMode() {
gtag('consent', 'default', {
this.gtag('consent', 'default', {
'ad_storage': 'denied',

@@ -81,3 +84,3 @@ 'ad_user_data': 'denied',

updateConsent(adStorage, adUserData, adPersonalization, analyticsStorage, functionalityStorage, personalizationStorage, securityStorage) {
gtag('consent', 'update', {
this.gtag('consent', 'update', {
/* Consent Type */

@@ -87,3 +90,2 @@ 'ad_storage': adStorage ? 'granted' : 'denied',

'ad_personalization': adPersonalization ? 'granted' : 'denied',
/* STORAGE TYPE */

@@ -90,0 +92,0 @@ 'analytics_storage': analyticsStorage ? 'granted' : 'denied',

@@ -1,1 +0,1 @@

class FerCookieBot{constructor(e,t,a={}){this.googleTagId=e,this.facebookPixelId=t||null,this.dialogId="consentDialog",this.language=document.documentElement.lang||"en",this.loadGTagScript(),this.translations=this.defineTranslations();let i=this.translations[this.language]||this.translations.en;this.translatedOptions={...i,...a},this.createConsentDialog(),this.loadConsentSettings(),this.checkDialogState(),this.attachEventListeners()}loadGTagScript(){let e=document.createElement("script");function t(){dataLayer.push(arguments)}e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${this.googleTagId}`,document.head.appendChild(e),window.dataLayer=window.dataLayer||[],t("js",new Date),t("config",this.googleTagId)}addFacebookPixel(){if(this.facebookPixelId&&/^\d{15}$/.test(this.facebookPixelId)){var e,t,a,i,o,s="script";e=window,t=document,e.fbq||(a=e.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},e._fbq||(e._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],(i=t.createElement(s)).async=!0,i.src="https://connect.facebook.net/en_US/fbevents.js",(o=t.getElementsByTagName(s)[0]).parentNode.insertBefore(i,o)),fbq("init",this.facebookPixelId),fbq("track","PageView"),this.addFacebookPixelNoscript()}}addFacebookPixelNoscript(){let e=document.createElement("noscript"),t=document.createElement("img");t.height=1,t.width=1,t.style.display="none",t.src=`https://www.facebook.com/tr?id=${this.facebookPixelId}&ev=PageView&noscript=1`,e.appendChild(t),document.body.insertBefore(e,document.body.firstChild)}initializeDefaultConsentMode(){gtag("consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied",functionality_storage:"denied",personalization_storage:"denied",security_storage:"denied"})}updateConsent(e,t,a,i,o,s,n){gtag("consent","update",{ad_storage:e?"granted":"denied",ad_user_data:t?"granted":"denied",ad_personalization:a?"granted":"denied",analytics_storage:i?"granted":"denied",functionality_storage:o?"granted":"denied",personalization_storage:s?"granted":"denied",security_storage:n?"granted":"denied"}),localStorage.setItem("consentSettings",JSON.stringify({adStorage:e,adUserData:t,adPersonalization:a,analyticsStorage:i,functionalityStorage:o,personalizationStorage:s,securityStorage:n}))}createConsentDialog(){let e=document.createElement("dialog");e.id=this.dialogId,document.body.appendChild(e);let t=document.createElement("div");t.id="consent_title",t.innerText=this.translatedOptions.title,e.appendChild(t);let a=[{id:"necessary_cookies",text:this.translatedOptions.necessary_cookies_title,disabled:!0,checked:!0},{id:"ad_storage",text:this.translatedOptions.ad_storage_title},{id:"ad_user_data",text:this.translatedOptions.ad_user_data_title},{id:"ad_personalization",text:this.translatedOptions.ad_personalization_title},{id:"analytics_storage",text:this.translatedOptions.analytics_storage_title},{id:"functionality_storage",text:this.translatedOptions.functionality_storage_title},{id:"personalization_storage",text:this.translatedOptions.personalization_storage_title},{id:"security_storage",text:this.translatedOptions.security_storage_title}];a.forEach(t=>{let a=document.createElement("label");a.className="consent-item";let i=document.createElement("input");i.type="checkbox",i.id=t.id,t.disabled&&(i.disabled=!0),t.checked&&(i.checked=!0);let o=document.createTextNode(" "+t.text);a.appendChild(i),a.appendChild(o),e.appendChild(a)});let i=document.createElement("div");i.id="consent_text",i.innerHTML=this.translatedOptions.consent_text+" "+this.translatedOptions.consent_link,e.appendChild(i);let o=document.createElement("button");o.id="saveAcceptAllCookieBotPreferences",o.className="consent-button",o.innerText=this.translatedOptions.accept_all_button_title;let s=document.createElement("button");s.id="saveRefuseAllCookieBotPreferences",s.className="consent-button",s.innerText=this.translatedOptions.refuse_all_button_title;let n=document.createElement("button");n.id="saveCookieBotPreferences",n.className="consent-button",n.innerText=this.translatedOptions.button_title,e.appendChild(o),e.appendChild(s),e.appendChild(n)}acceptAndSaveAll(){this.updateConsent(!0,!0,!0,!0,!0,!0,!0),this.loadConsentSettings(),localStorage.setItem("dialogState","closed"),this.closeDialog()}refuseAndSaveAll(){this.updateConsent(!1,!1,!1,!1,!1,!1,!1),this.loadConsentSettings(),localStorage.setItem("dialogState","closed"),this.closeDialog()}loadConsentSettings(){let e=JSON.parse(localStorage.getItem("consentSettings"));e?(document.getElementById("ad_storage").checked=e.adStorage,document.getElementById("ad_user_data").checked=e.adUserData,document.getElementById("ad_personalization").checked=e.adPersonalization,document.getElementById("analytics_storage").checked=e.analyticsStorage,document.getElementById("functionality_storage").checked=e.functionalityStorage,document.getElementById("personalization_storage").checked=e.personalizationStorage,document.getElementById("security_storage").checked=e.securityStorage,this.updateConsent(e.adStorage,e.adUserData,e.adPersonalization,e.analyticsStorage,e.functionalityStorage,e.personalizationStorage,e.securityStorage)):this.initializeDefaultConsentMode(),e&&!0==e.adStorage&&!0==e.adUserData&&this.addFacebookPixel()}checkDialogState(){let e=localStorage.getItem("dialogState");"closed"===e?this.closeDialog():this.openDialog()}openDialog(){let e=document.getElementById(this.dialogId);e?e.showModal():console.error("Dialog element not found")}closeDialog(){let e=document.getElementById(this.dialogId);e&&e.close()}attachEventListeners(){let e=document.getElementById("saveCookieBotPreferences");e&&e.addEventListener("click",()=>{this.saveCookieBotPreferences()});let t=document.getElementById("saveAcceptAllCookieBotPreferences");t&&t.addEventListener("click",()=>{this.acceptAndSaveAll()});let a=document.getElementById("saveRefuseAllCookieBotPreferences");a&&a.addEventListener("click",()=>{this.refuseAndSaveAll()}),document.getElementById("changeCookieBotPreferences")&&document.getElementById("changeCookieBotPreferences").addEventListener("click",()=>{this.openDialog()})}saveCookieBotPreferences(){let e=document.getElementById("ad_storage").checked,t=document.getElementById("ad_user_data").checked,a=document.getElementById("ad_personalization").checked,i=document.getElementById("analytics_storage").checked,o=document.getElementById("functionality_storage").checked,s=document.getElementById("personalization_storage").checked,n=document.getElementById("security_storage").checked;this.updateConsent(e,t,a,i,o,s,n),localStorage.setItem("dialogState","closed"),this.closeDialog()}defineTranslations(){return{hr:{title:"Privola za korištenje osobnih podataka",necessary_cookies_title:"Nužni kolačići",ad_storage_title:"Oglašavački kolačići",ad_user_data_title:"Korištenje podataka o oglašavanju",ad_personalization_title:"Personalizacija oglasa",analytics_storage_title:"Kolačići analitike",functionality_storage_title:"Kolačići funkcionalnosti",personalization_storage_title:"Kolačići personalizacije",security_storage_title:"Kolačići sigurnosti",button_title:"Spremi odabrano",accept_all_button_title:"Prihvati sve",refuse_all_button_title:"Odbaci sve",consent_text:"Ova web-stranica koristi kolačiće. Kolačiće upotrebljavamo kako bismo personalizirali sadržaj i oglase, omogućili značajke društvenih medija i analizirali promet.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Opširnije</a>"},en:{title:"Consent for the Use of Personal Data",necessary_cookies_title:"Necessary Cookies",ad_storage_title:"Advertising Cookies",ad_user_data_title:"Use of Advertising Data",ad_personalization_title:"Ad Personalization",analytics_storage_title:"Analytics Cookies",functionality_storage_title:"Functionality Cookies",personalization_storage_title:"Personalization Cookies",security_storage_title:"Security Cookies",button_title:"Save Selected",accept_all_button_title:"Accept All",refuse_all_button_title:"Refuse All",consent_text:"This website uses cookies. We use cookies to personalize content and ads, to provide social media features, and to analyze our traffic.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Learn More</a>"},de:{title:"Zustimmung zur Verwendung pers\xf6nlicher Daten",necessary_cookies_title:"Notwendige Cookies",ad_storage_title:"Werbe-Cookies",ad_user_data_title:"Nutzung von Werbedaten",ad_personalization_title:"Anzeigenpersonalisierung",analytics_storage_title:"Analytische Cookies",functionality_storage_title:"Funktionalit\xe4ts-Cookies",personalization_storage_title:"Personalisierungs-Cookies",security_storage_title:"Sicherheits-Cookies",button_title:"Ausgew\xe4hltes speichern",accept_all_button_title:"Alles akzeptieren",refuse_all_button_title:"Alles ablehnen",consent_text:"Diese Webseite verwendet Cookies. Wir verwenden Cookies, um Inhalte und Anzeigen zu personalisieren, Funktionen f\xfcr soziale Medien anzubieten und unseren Verkehr zu analysieren.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Mehr erfahren</a>"},it:{title:"Consenso per l'uso dei dati personali",necessary_cookies_title:"Cookie necessari",ad_storage_title:"Cookie pubblicitari",ad_user_data_title:"Uso dei dati pubblicitari",ad_personalization_title:"Personalizzazione degli annunci",analytics_storage_title:"Cookie analitici",functionality_storage_title:"Cookie di funzionalit\xe0",personalization_storage_title:"Cookie di personalizzazione",security_storage_title:"Cookie di sicurezza",button_title:"Salva selezionati",accept_all_button_title:"Accetta tutto",refuse_all_button_title:"Rifiuta tutto",consent_text:"Questo sito utilizza i cookie. Utilizziamo i cookie per personalizzare contenuti e annunci, fornire funzioni dei social media e analizzare il nostro traffico.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Scopri di pi\xf9</a>"},ru:{title:"Согласие на использование личных данных",necessary_cookies_title:"Необходимые куки",ad_storage_title:"Куки для рекламы",ad_user_data_title:"Использование данных рекламы",ad_personalization_title:"Персонализация рекламы",analytics_storage_title:"Аналитические куки",functionality_storage_title:"Функциональные куки",personalization_storage_title:"Куки персонализации",security_storage_title:"Куки безопасности",button_title:"Сохранить выбранное",accept_all_button_title:"Принять все",refuse_all_button_title:"Отклонить все",consent_text:"Этот сайт использует куки. Мы используем куки для персонализации контента и рекламы, предоставления функций социальных сетей и анализа трафика.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Узнать больше</a>"},pl:{title:"Zgoda na używanie danych osobowych",necessary_cookies_title:"Niezbędne ciasteczka",ad_storage_title:"Ciasteczka reklamowe",ad_user_data_title:"Użycie danych reklamowych",ad_personalization_title:"Personalizacja reklam",analytics_storage_title:"Ciasteczka analityczne",functionality_storage_title:"Ciasteczka funkcjonalności",personalization_storage_title:"Ciasteczka personalizacji",security_storage_title:"Ciasteczka bezpieczeństwa",button_title:"Zapisz wybrane",accept_all_button_title:"Zaakceptuj wszystko",refuse_all_button_title:"Odrzuć wszystko",consent_text:"Ta strona używa ciasteczek. Używamy ciasteczek do personalizacji treści i reklam, oferowania funkcji medi\xf3w społecznościowych i analizowania naszego ruchu.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Dowiedz się więcej</a>"},sl:{title:"Privolitev za uporabo osebnih podatkov",necessary_cookies_title:"Nujni piškotki",ad_storage_title:"Oglaševalski piškotki",ad_user_data_title:"Uporaba oglaševalskih podatkov",ad_personalization_title:"Personalizacija oglasov",analytics_storage_title:"Analitični piškotki",functionality_storage_title:"Piškotki funkcionalnosti",personalization_storage_title:"Piškotki personalizacije",security_storage_title:"Piškotki varnosti",button_title:"Shrani izbrano",accept_all_button_title:"Sprejmi vse",refuse_all_button_title:"Zavrni vse",consent_text:"Ta spletna stran uporablja piškotke. Uporabljamo piškotke za prilagajanje vsebine in oglasov, zagotavljanje funkcij socialnih medijev in analizo prometa.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Več informacij</a>"},cs:{title:"Souhlas s použ\xedv\xe1n\xedm osobn\xedch \xfadajů",necessary_cookies_title:"Nezbytn\xe9 cookies",ad_storage_title:"Reklamn\xed cookies",ad_user_data_title:"Využit\xed reklamn\xedch dat",ad_personalization_title:"Personalizace reklam",analytics_storage_title:"Analytick\xe9 cookies",functionality_storage_title:"Funkčn\xed cookies",personalization_storage_title:"Cookies pro personalizaci",security_storage_title:"Bezpečnostn\xed cookies",button_title:"Uložit vybran\xe9",accept_all_button_title:"Přijmout vše",refuse_all_button_title:"Odm\xedtnout vše",consent_text:"Tento web použ\xedv\xe1 cookies. Cookies použ\xedv\xe1me k personalizaci obsahu a reklam, k poskytov\xe1n\xed funkc\xed soci\xe1ln\xedch s\xedt\xed a k anal\xfdze našeho provozu.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>V\xedce informac\xed</a>"},nl:{title:"Toestemming voor het gebruik van persoonsgegevens",necessary_cookies_title:"Noodzakelijke cookies",ad_storage_title:"Advertentiecookies",ad_user_data_title:"Gebruik van advertentiegegevens",ad_personalization_title:"Advertentiepersonalisatie",analytics_storage_title:"Analytische cookies",functionality_storage_title:"Functionaliteitscookies",personalization_storage_title:"Personalisatiecookies",security_storage_title:"Beveiligingscookies",button_title:"Geselecteerde opslaan",accept_all_button_title:"Accepteer alles",refuse_all_button_title:"Weiger alles",consent_text:"Deze website gebruikt cookies. We gebruiken cookies om content en advertenties te personaliseren, om sociale mediafuncties te bieden en om ons verkeer te analyseren.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Meer weten</a>"},is:{title:"Sam\xfeykki fyrir notkun pers\xf3nuuppl\xfdsinga",necessary_cookies_title:"Nau\xf0synlegar k\xf6kur",ad_storage_title:"Augl\xfdsingak\xf6kur",ad_user_data_title:"Notkun augl\xfdsingagagna",ad_personalization_title:"S\xe9rsni\xf0nar augl\xfdsingar",analytics_storage_title:"Greiningark\xf6kur",functionality_storage_title:"Virknik\xf6kur",personalization_storage_title:"S\xe9rsni\xf0nar k\xf6kur",security_storage_title:"\xd6ryggisk\xf6kur",button_title:"Vista val",accept_all_button_title:"Sam\xfeykkja allt",refuse_all_button_title:"Hafna \xf6llu",consent_text:"\xdeessi vefs\xed\xf0a notar k\xf6kur. Vi\xf0 notum k\xf6kur til a\xf0 s\xe9rsn\xed\xf0a efni og augl\xfdsingar, bj\xf3\xf0a upp \xe1 samf\xe9lagsmi\xf0laeiginleika og greina umfer\xf0 okkar.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>L\xe6ra meira</a>"},fr:{title:"Consentement pour l'utilisation des donn\xe9es personnelles",necessary_cookies_title:"Cookies n\xe9cessaires",ad_storage_title:"Cookies publicitaires",ad_user_data_title:"Utilisation des donn\xe9es publicitaires",ad_personalization_title:"Personnalisation des publicit\xe9s",analytics_storage_title:"Cookies analytiques",functionality_storage_title:"Cookies de fonctionnalit\xe9",personalization_storage_title:"Cookies de personnalisation",security_storage_title:"Cookies de s\xe9curit\xe9",button_title:"Sauvegarder la s\xe9lection",accept_all_button_title:"Tout accepter",refuse_all_button_title:"Tout refuser",consent_text:"Ce site utilise des cookies. Nous utilisons des cookies pour personnaliser le contenu et les annonces, offrir des fonctionnalit\xe9s de m\xe9dias sociaux et analyser notre trafic.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>En savoir plus</a>"},hu:{title:"Hozz\xe1j\xe1rul\xe1s a szem\xe9lyes adatok haszn\xe1lat\xe1hoz",necessary_cookies_title:"Sz\xfcks\xe9ges s\xfctik",ad_storage_title:"Hirdet\xe9si s\xfctik",ad_user_data_title:"Hirdet\xe9si adatok haszn\xe1lata",ad_personalization_title:"Hirdet\xe9sek szem\xe9lyre szab\xe1sa",analytics_storage_title:"Analitikai s\xfctik",functionality_storage_title:"Funkcionalit\xe1s s\xfctik",personalization_storage_title:"Szem\xe9lyre szab\xe1si s\xfctik",security_storage_title:"Biztons\xe1gi s\xfctik",button_title:"Kiv\xe1lasztottak ment\xe9se",accept_all_button_title:"\xd6sszes elfogad\xe1sa",refuse_all_button_title:"\xd6sszes elutas\xedt\xe1sa",consent_text:"Ez a weboldal s\xfctiket haszn\xe1l. S\xfctiket haszn\xe1lunk a tartalom \xe9s hirdet\xe9sek szem\xe9lyre szab\xe1s\xe1hoz, a k\xf6z\xf6ss\xe9gi m\xe9dia funkci\xf3k biztos\xedt\xe1s\xe1hoz \xe9s forgalmunk elemz\xe9s\xe9hez.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Tudj meg t\xf6bbet</a>"}}}}export default FerCookieBot;
class FerCookieBot{constructor(e,t,a={}){this.googleTagId=e,this.facebookPixelId=t||null,this.dialogId="consentDialog",this.language=document.documentElement.lang||"en",this.loadGTagScript(),this.translations=this.defineTranslations();let i=this.translations[this.language]||this.translations.en;this.translatedOptions={...i,...a},this.createConsentDialog(),this.loadConsentSettings(),this.checkDialogState(),this.attachEventListeners()}gtag(){dataLayer.push(arguments)}loadGTagScript(){let e=document.createElement("script");e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${this.googleTagId}`,document.head.appendChild(e),window.dataLayer=window.dataLayer||[],this.gtag("js",new Date),this.gtag("config",this.googleTagId)}addFacebookPixel(){if(this.facebookPixelId&&/^\d{15}$/.test(this.facebookPixelId)){var e,t,a,i,o,s="script";e=window,t=document,e.fbq||(a=e.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},e._fbq||(e._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],(i=t.createElement(s)).async=!0,i.src="https://connect.facebook.net/en_US/fbevents.js",(o=t.getElementsByTagName(s)[0]).parentNode.insertBefore(i,o)),fbq("init",this.facebookPixelId),fbq("track","PageView"),this.addFacebookPixelNoscript()}}addFacebookPixelNoscript(){let e=document.createElement("noscript"),t=document.createElement("img");t.height=1,t.width=1,t.style.display="none",t.src=`https://www.facebook.com/tr?id=${this.facebookPixelId}&ev=PageView&noscript=1`,e.appendChild(t),document.body.insertBefore(e,document.body.firstChild)}initializeDefaultConsentMode(){this.gtag("consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied",functionality_storage:"denied",personalization_storage:"denied",security_storage:"denied"})}updateConsent(e,t,a,i,o,s,n){this.gtag("consent","update",{ad_storage:e?"granted":"denied",ad_user_data:t?"granted":"denied",ad_personalization:a?"granted":"denied",analytics_storage:i?"granted":"denied",functionality_storage:o?"granted":"denied",personalization_storage:s?"granted":"denied",security_storage:n?"granted":"denied"}),localStorage.setItem("consentSettings",JSON.stringify({adStorage:e,adUserData:t,adPersonalization:a,analyticsStorage:i,functionalityStorage:o,personalizationStorage:s,securityStorage:n}))}createConsentDialog(){let e=document.createElement("dialog");e.id=this.dialogId,document.body.appendChild(e);let t=document.createElement("div");t.id="consent_title",t.innerText=this.translatedOptions.title,e.appendChild(t);let a=[{id:"necessary_cookies",text:this.translatedOptions.necessary_cookies_title,disabled:!0,checked:!0},{id:"ad_storage",text:this.translatedOptions.ad_storage_title},{id:"ad_user_data",text:this.translatedOptions.ad_user_data_title},{id:"ad_personalization",text:this.translatedOptions.ad_personalization_title},{id:"analytics_storage",text:this.translatedOptions.analytics_storage_title},{id:"functionality_storage",text:this.translatedOptions.functionality_storage_title},{id:"personalization_storage",text:this.translatedOptions.personalization_storage_title},{id:"security_storage",text:this.translatedOptions.security_storage_title}];a.forEach(t=>{let a=document.createElement("label");a.className="consent-item";let i=document.createElement("input");i.type="checkbox",i.id=t.id,t.disabled&&(i.disabled=!0),t.checked&&(i.checked=!0);let o=document.createTextNode(" "+t.text);a.appendChild(i),a.appendChild(o),e.appendChild(a)});let i=document.createElement("div");i.id="consent_text",i.innerHTML=this.translatedOptions.consent_text+" "+this.translatedOptions.consent_link,e.appendChild(i);let o=document.createElement("button");o.id="saveAcceptAllCookieBotPreferences",o.className="consent-button",o.innerText=this.translatedOptions.accept_all_button_title;let s=document.createElement("button");s.id="saveRefuseAllCookieBotPreferences",s.className="consent-button",s.innerText=this.translatedOptions.refuse_all_button_title;let n=document.createElement("button");n.id="saveCookieBotPreferences",n.className="consent-button",n.innerText=this.translatedOptions.button_title,e.appendChild(o),e.appendChild(s),e.appendChild(n)}acceptAndSaveAll(){this.updateConsent(!0,!0,!0,!0,!0,!0,!0),this.loadConsentSettings(),localStorage.setItem("dialogState","closed"),this.closeDialog()}refuseAndSaveAll(){this.updateConsent(!1,!1,!1,!1,!1,!1,!1),this.loadConsentSettings(),localStorage.setItem("dialogState","closed"),this.closeDialog()}loadConsentSettings(){let e=JSON.parse(localStorage.getItem("consentSettings"));e?(document.getElementById("ad_storage").checked=e.adStorage,document.getElementById("ad_user_data").checked=e.adUserData,document.getElementById("ad_personalization").checked=e.adPersonalization,document.getElementById("analytics_storage").checked=e.analyticsStorage,document.getElementById("functionality_storage").checked=e.functionalityStorage,document.getElementById("personalization_storage").checked=e.personalizationStorage,document.getElementById("security_storage").checked=e.securityStorage,this.updateConsent(e.adStorage,e.adUserData,e.adPersonalization,e.analyticsStorage,e.functionalityStorage,e.personalizationStorage,e.securityStorage)):this.initializeDefaultConsentMode(),e&&!0==e.adStorage&&!0==e.adUserData&&this.addFacebookPixel()}checkDialogState(){let e=localStorage.getItem("dialogState");"closed"===e?this.closeDialog():this.openDialog()}openDialog(){let e=document.getElementById(this.dialogId);e?e.showModal():console.error("Dialog element not found")}closeDialog(){let e=document.getElementById(this.dialogId);e&&e.close()}attachEventListeners(){let e=document.getElementById("saveCookieBotPreferences");e&&e.addEventListener("click",()=>{this.saveCookieBotPreferences()});let t=document.getElementById("saveAcceptAllCookieBotPreferences");t&&t.addEventListener("click",()=>{this.acceptAndSaveAll()});let a=document.getElementById("saveRefuseAllCookieBotPreferences");a&&a.addEventListener("click",()=>{this.refuseAndSaveAll()}),document.getElementById("changeCookieBotPreferences")&&document.getElementById("changeCookieBotPreferences").addEventListener("click",()=>{this.openDialog()})}saveCookieBotPreferences(){let e=document.getElementById("ad_storage").checked,t=document.getElementById("ad_user_data").checked,a=document.getElementById("ad_personalization").checked,i=document.getElementById("analytics_storage").checked,o=document.getElementById("functionality_storage").checked,s=document.getElementById("personalization_storage").checked,n=document.getElementById("security_storage").checked;this.updateConsent(e,t,a,i,o,s,n),localStorage.setItem("dialogState","closed"),this.closeDialog()}defineTranslations(){return{hr:{title:"Privola za korištenje osobnih podataka",necessary_cookies_title:"Nužni kolačići",ad_storage_title:"Oglašavački kolačići",ad_user_data_title:"Korištenje podataka o oglašavanju",ad_personalization_title:"Personalizacija oglasa",analytics_storage_title:"Kolačići analitike",functionality_storage_title:"Kolačići funkcionalnosti",personalization_storage_title:"Kolačići personalizacije",security_storage_title:"Kolačići sigurnosti",button_title:"Spremi odabrano",accept_all_button_title:"Prihvati sve",refuse_all_button_title:"Odbaci sve",consent_text:"Ova web-stranica koristi kolačiće. Kolačiće upotrebljavamo kako bismo personalizirali sadržaj i oglase, omogućili značajke društvenih medija i analizirali promet.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Opširnije</a>"},en:{title:"Consent for the Use of Personal Data",necessary_cookies_title:"Necessary Cookies",ad_storage_title:"Advertising Cookies",ad_user_data_title:"Use of Advertising Data",ad_personalization_title:"Ad Personalization",analytics_storage_title:"Analytics Cookies",functionality_storage_title:"Functionality Cookies",personalization_storage_title:"Personalization Cookies",security_storage_title:"Security Cookies",button_title:"Save Selected",accept_all_button_title:"Accept All",refuse_all_button_title:"Refuse All",consent_text:"This website uses cookies. We use cookies to personalize content and ads, to provide social media features, and to analyze our traffic.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Learn More</a>"},de:{title:"Zustimmung zur Verwendung pers\xf6nlicher Daten",necessary_cookies_title:"Notwendige Cookies",ad_storage_title:"Werbe-Cookies",ad_user_data_title:"Nutzung von Werbedaten",ad_personalization_title:"Anzeigenpersonalisierung",analytics_storage_title:"Analytische Cookies",functionality_storage_title:"Funktionalit\xe4ts-Cookies",personalization_storage_title:"Personalisierungs-Cookies",security_storage_title:"Sicherheits-Cookies",button_title:"Ausgew\xe4hltes speichern",accept_all_button_title:"Alles akzeptieren",refuse_all_button_title:"Alles ablehnen",consent_text:"Diese Webseite verwendet Cookies. Wir verwenden Cookies, um Inhalte und Anzeigen zu personalisieren, Funktionen f\xfcr soziale Medien anzubieten und unseren Verkehr zu analysieren.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Mehr erfahren</a>"},it:{title:"Consenso per l'uso dei dati personali",necessary_cookies_title:"Cookie necessari",ad_storage_title:"Cookie pubblicitari",ad_user_data_title:"Uso dei dati pubblicitari",ad_personalization_title:"Personalizzazione degli annunci",analytics_storage_title:"Cookie analitici",functionality_storage_title:"Cookie di funzionalit\xe0",personalization_storage_title:"Cookie di personalizzazione",security_storage_title:"Cookie di sicurezza",button_title:"Salva selezionati",accept_all_button_title:"Accetta tutto",refuse_all_button_title:"Rifiuta tutto",consent_text:"Questo sito utilizza i cookie. Utilizziamo i cookie per personalizzare contenuti e annunci, fornire funzioni dei social media e analizzare il nostro traffico.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Scopri di pi\xf9</a>"},ru:{title:"Согласие на использование личных данных",necessary_cookies_title:"Необходимые куки",ad_storage_title:"Куки для рекламы",ad_user_data_title:"Использование данных рекламы",ad_personalization_title:"Персонализация рекламы",analytics_storage_title:"Аналитические куки",functionality_storage_title:"Функциональные куки",personalization_storage_title:"Куки персонализации",security_storage_title:"Куки безопасности",button_title:"Сохранить выбранное",accept_all_button_title:"Принять все",refuse_all_button_title:"Отклонить все",consent_text:"Этот сайт использует куки. Мы используем куки для персонализации контента и рекламы, предоставления функций социальных сетей и анализа трафика.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Узнать больше</a>"},pl:{title:"Zgoda na używanie danych osobowych",necessary_cookies_title:"Niezbędne ciasteczka",ad_storage_title:"Ciasteczka reklamowe",ad_user_data_title:"Użycie danych reklamowych",ad_personalization_title:"Personalizacja reklam",analytics_storage_title:"Ciasteczka analityczne",functionality_storage_title:"Ciasteczka funkcjonalności",personalization_storage_title:"Ciasteczka personalizacji",security_storage_title:"Ciasteczka bezpieczeństwa",button_title:"Zapisz wybrane",accept_all_button_title:"Zaakceptuj wszystko",refuse_all_button_title:"Odrzuć wszystko",consent_text:"Ta strona używa ciasteczek. Używamy ciasteczek do personalizacji treści i reklam, oferowania funkcji medi\xf3w społecznościowych i analizowania naszego ruchu.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Dowiedz się więcej</a>"},sl:{title:"Privolitev za uporabo osebnih podatkov",necessary_cookies_title:"Nujni piškotki",ad_storage_title:"Oglaševalski piškotki",ad_user_data_title:"Uporaba oglaševalskih podatkov",ad_personalization_title:"Personalizacija oglasov",analytics_storage_title:"Analitični piškotki",functionality_storage_title:"Piškotki funkcionalnosti",personalization_storage_title:"Piškotki personalizacije",security_storage_title:"Piškotki varnosti",button_title:"Shrani izbrano",accept_all_button_title:"Sprejmi vse",refuse_all_button_title:"Zavrni vse",consent_text:"Ta spletna stran uporablja piškotke. Uporabljamo piškotke za prilagajanje vsebine in oglasov, zagotavljanje funkcij socialnih medijev in analizo prometa.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Več informacij</a>"},cs:{title:"Souhlas s použ\xedv\xe1n\xedm osobn\xedch \xfadajů",necessary_cookies_title:"Nezbytn\xe9 cookies",ad_storage_title:"Reklamn\xed cookies",ad_user_data_title:"Využit\xed reklamn\xedch dat",ad_personalization_title:"Personalizace reklam",analytics_storage_title:"Analytick\xe9 cookies",functionality_storage_title:"Funkčn\xed cookies",personalization_storage_title:"Cookies pro personalizaci",security_storage_title:"Bezpečnostn\xed cookies",button_title:"Uložit vybran\xe9",accept_all_button_title:"Přijmout vše",refuse_all_button_title:"Odm\xedtnout vše",consent_text:"Tento web použ\xedv\xe1 cookies. Cookies použ\xedv\xe1me k personalizaci obsahu a reklam, k poskytov\xe1n\xed funkc\xed soci\xe1ln\xedch s\xedt\xed a k anal\xfdze našeho provozu.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>V\xedce informac\xed</a>"},nl:{title:"Toestemming voor het gebruik van persoonsgegevens",necessary_cookies_title:"Noodzakelijke cookies",ad_storage_title:"Advertentiecookies",ad_user_data_title:"Gebruik van advertentiegegevens",ad_personalization_title:"Advertentiepersonalisatie",analytics_storage_title:"Analytische cookies",functionality_storage_title:"Functionaliteitscookies",personalization_storage_title:"Personalisatiecookies",security_storage_title:"Beveiligingscookies",button_title:"Geselecteerde opslaan",accept_all_button_title:"Accepteer alles",refuse_all_button_title:"Weiger alles",consent_text:"Deze website gebruikt cookies. We gebruiken cookies om content en advertenties te personaliseren, om sociale mediafuncties te bieden en om ons verkeer te analyseren.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Meer weten</a>"},is:{title:"Sam\xfeykki fyrir notkun pers\xf3nuuppl\xfdsinga",necessary_cookies_title:"Nau\xf0synlegar k\xf6kur",ad_storage_title:"Augl\xfdsingak\xf6kur",ad_user_data_title:"Notkun augl\xfdsingagagna",ad_personalization_title:"S\xe9rsni\xf0nar augl\xfdsingar",analytics_storage_title:"Greiningark\xf6kur",functionality_storage_title:"Virknik\xf6kur",personalization_storage_title:"S\xe9rsni\xf0nar k\xf6kur",security_storage_title:"\xd6ryggisk\xf6kur",button_title:"Vista val",accept_all_button_title:"Sam\xfeykkja allt",refuse_all_button_title:"Hafna \xf6llu",consent_text:"\xdeessi vefs\xed\xf0a notar k\xf6kur. Vi\xf0 notum k\xf6kur til a\xf0 s\xe9rsn\xed\xf0a efni og augl\xfdsingar, bj\xf3\xf0a upp \xe1 samf\xe9lagsmi\xf0laeiginleika og greina umfer\xf0 okkar.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>L\xe6ra meira</a>"},fr:{title:"Consentement pour l'utilisation des donn\xe9es personnelles",necessary_cookies_title:"Cookies n\xe9cessaires",ad_storage_title:"Cookies publicitaires",ad_user_data_title:"Utilisation des donn\xe9es publicitaires",ad_personalization_title:"Personnalisation des publicit\xe9s",analytics_storage_title:"Cookies analytiques",functionality_storage_title:"Cookies de fonctionnalit\xe9",personalization_storage_title:"Cookies de personnalisation",security_storage_title:"Cookies de s\xe9curit\xe9",button_title:"Sauvegarder la s\xe9lection",accept_all_button_title:"Tout accepter",refuse_all_button_title:"Tout refuser",consent_text:"Ce site utilise des cookies. Nous utilisons des cookies pour personnaliser le contenu et les annonces, offrir des fonctionnalit\xe9s de m\xe9dias sociaux et analyser notre trafic.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>En savoir plus</a>"},hu:{title:"Hozz\xe1j\xe1rul\xe1s a szem\xe9lyes adatok haszn\xe1lat\xe1hoz",necessary_cookies_title:"Sz\xfcks\xe9ges s\xfctik",ad_storage_title:"Hirdet\xe9si s\xfctik",ad_user_data_title:"Hirdet\xe9si adatok haszn\xe1lata",ad_personalization_title:"Hirdet\xe9sek szem\xe9lyre szab\xe1sa",analytics_storage_title:"Analitikai s\xfctik",functionality_storage_title:"Funkcionalit\xe1s s\xfctik",personalization_storage_title:"Szem\xe9lyre szab\xe1si s\xfctik",security_storage_title:"Biztons\xe1gi s\xfctik",button_title:"Kiv\xe1lasztottak ment\xe9se",accept_all_button_title:"\xd6sszes elfogad\xe1sa",refuse_all_button_title:"\xd6sszes elutas\xedt\xe1sa",consent_text:"Ez a weboldal s\xfctiket haszn\xe1l. S\xfctiket haszn\xe1lunk a tartalom \xe9s hirdet\xe9sek szem\xe9lyre szab\xe1s\xe1hoz, a k\xf6z\xf6ss\xe9gi m\xe9dia funkci\xf3k biztos\xedt\xe1s\xe1hoz \xe9s forgalmunk elemz\xe9s\xe9hez.",consent_link:"<a href='https://policies.google.com/privacy' target='_blank'>Tudj meg t\xf6bbet</a>"}}}}export default FerCookieBot;
{
"name": "fer-cookie-bot",
"version": "1.2.0",
"version": "1.2.1",
"description": "FerCookieBot is JavaScript solution designed for website owners to manage user consents for cookies and tracking technologies, ensuring compliance with data protection regulations like GDPR and CCPA. It now seamlessly integrates with both Google Consent Mode v2 and Facebook Pixel, offering dynamic consent handling and a respectful, legal approach to user data across major advertising platforms.",

@@ -5,0 +5,0 @@ "main": "fer-cookiebot.js",

Sorry, the diff of this file is not supported yet

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