GithubHelp home page GithubHelp logo

nicholasruggeri / cookies-enabler Goto Github PK

View Code? Open in Web Editor NEW
121.0 121.0 27.0 102 KB

Easy-to-use pure Javascript solution for preventively blocking third-party cookies installed by js and comply with the EU cookie law.

License: MIT License

JavaScript 100.00%

cookies-enabler's Introduction

             ┏━━━━━━━━Stats━━━━━━━┓  ┏━━━━━━━Tetris━━━━━━━┓  ┏━━━━━━Next━━━━━━┓                     
             ┃ Score        15480 ┃  ┃ . . . . . . . . . .┃  ┃                ┃                     
             ┃                    ┃  ┃ . . . . . . . . . .┃  ┃       . . .    ┃                     
             ┃ Level            0 ┃  ┃ . . . . . . . . . .┃  ┃         .      ┃                     
             ┗━━━━━━━━━━━━━━━━━━━━┛  ┃ . . . . . . . . . .┃  ┃                ┃                     
                                     ┃ . . . . . . . . . .┃  ┗━━━━━━━━━━━━━━━━┛                     
                                     ┃ . . . . . . . . . .┃                                         
                                     ┃ . . . . . . . . . .┃  ┏━━━━━━Help━━━━━━┓                     
                                     ┃ . . . . . . . . . .┃  ┃                ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Left      h, ← ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Right     l, → ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Down      j, ↓ ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Rotate    k, ↑ ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Drop     space ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Restart      r ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Pause        p ┃                     
                                     ┃ . . . . . . . . . .┃  ┃ Quit         q ┃                     
                                     ┃ . . . . . . . . . .┃  ┃                ┃                     
                                     ┃ . . . . . . . . . .┃  ┗━━━━━━━━━━━━━━━━┛                     
                                     ┃ . . . . . . . . . .┃                                         
                                     ┃ . . . . . . . . . .┃                                         
                                     ┗━━━━━━━━━━━━━━━━━━━━┛         

cookies-enabler's People

Contributors

christiangiupponi avatar giando110188 avatar gsimone avatar kilbourne avatar marzapower avatar nicholasruggeri avatar psantori avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cookies-enabler's Issues

Youtube autolay IFrame Player API

Hi, thanks for the nice script!
I am using the IFrame Player API to add background autoplay youtube videos to my page.

                ytp = new YT.Player(element, {
                    height: '1080',
                    width: '1920',
                    videoId: ytid,
                    playerVars: {
                        'controls': 0,
                        'autoplay': 1,
                        'mute': 1,
                        'origin': window.location.origin,
                        'loop': 1,
                        'rel': 0,
                        'showinfo': 0,
                        'modestbranding': 1
                    },
                    events: {
                        'onReady': onVideoPlayerReady,
                        'onStateChange': onVideoStateChange
                    }
                });

Example: https://codepen.io/heyflo/pen/zLzpJJ

So i cant change the src to data-src, only after it was inserted and cookies are already set. Any idea how to handle that?

Problema nel confronto document.getElementById('ce-banner-html') !== null

Pur avendo inserito nella home un

<script id="ce-banner-html" type="text/plain">

Per offrire una migliore esperienza di navigazione, per avere statistiche relative all'uso dei nostri servizi e per farti visualizzare contenuti pubblicitari in linea con le tue preferenze ed esigenze, questo sito usa cookie anche di terze parti. Chi sceglie di proseguire nella navigazione o di cliccare al di fuori di esso, esprime il consenso all'uso dei cookie.

Accetto Non Accetto or Informativa X

</script>

il confronto
document.getElementById('ce-banner-html') !== null ?
ritorna sempre null

adsense in wrong

<script type="text/plain" class="ce-script"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
 </script>

this dont work

click outside don't work

Hello,
this is the demo inside the zip and I added a select or a textarea but the click outside don't work, why? I'm making something wrong? For which elements works correctly?

edit: Non mi ero accorto fossi italiano :) Ho preso il file di esempio dallo zip ma non funziona, dove sbaglio?

senza-titolo-1

IE10 & Android browser 4.2.2 problem

Ciao. dopo l'ultimo aggiornamento IE 10 non crasha più (ottimo). Però se clikko accetto o sul banner o sul Iframeplaceholder, compaiono gli elementi sbloccati (iframe) ma non scompaiono ne il banner ne il messaggio dell 'iframeplaceholder. Questo sia su IE 10 che nel browser di android 4.2.2. Grazie cmq per il lavoro che state facendo.

Hello. since the last update IE 10 does not crash more (great). But if clik accept or banner or Iframeplaceholder, appear elements unlocked (iframe) but it does not disappear the banner it the message of 'iframeplaceholder. This is about 10 IE and the browser of Android 4.2.2. Thanks for the work you are doing.

TripAdvisor badge not enabled

Hi!
I'm using you script and it works really great, but it seems that TripAdvisor badge does not become active when scripts.get() inject script tag.
Do you have any suggestion about that?
Thx!

Reload

Hi, good and simple solution -:)
Is't reload page?
Is't possibile a selective on/off some type of cookies?

Android 4.2.2 problem

Purtroppo ho notato che il tuo script non funziona nel browser di android 4.2.2. Quando ho un'iframe, e clikko sul messaggio per farlo comparire, non scompare ne il banner ne il messaggio.

Stessa cosa succede con IE 10 desktop e su IE9 non compare il pulsante di sblocco degli iframe

Praticamente con il iframesPlaceholder da errore (IE addiritutra mi si è impallato).

Mi correggo l' iframesPlaceholder da errore anche se disabilitato su IE (impalla il browser) mentre sul browser di android funziona se disabilitato

Click outside non funziona se il click è su un link

Il click su un link esterno al banner dell'informativa breve non accetta i cookie e non nasconde il banner.
Il test lo puoi vedere qui:
http://www.print66.it/branch/test
il click link di test che porta alla stessa pagina non accetta i cookie perché l'evento del cambio pagina viene prima di ogni altro comando. Inserendo un event.preventDefault() nella funzione document.addEventListener("click", function(e){}) allora la funzione enableCookies() viene eseguita ma ovviamente il browser non si sposta sull'url del link cliccato a funzione eseguita.
Sistemato questo problema direi che il plugin funziona perfettamente ed è in regola con le recenti precisazioni del garante.

grazie ancora

Marcello Serafini

eventScroll offset

Secondo me ci vorrebbe un'opzione per definire un offset (in pixel) oltre il quale allo scroll il banner scompare. Così scompare anche se scorri per sbaglio di uno solo pixel.

apache error

Installed this plugin on wordpress, apache log is full of these:

script not found:<script>
COOKIES_ENABLER.init({
scriptClass: 'ginger-script',
iframeClass: 'ginger-iframe',
acceptClass: 'ginger-accept',
disableClass: 'ginger-disable',
dismissClass: 'ginger-dismiss',
bannerClass: 'ginger_banner-wrapper',
bannerHTML:
document.getElementById('ginger-banner-html') !== null ?
document.getElementById('ginger-banner-html').innerHTML :
'

'
+''
+ 'Ho capito - Got it'
+'</a>'
+'

'
+'Questo sito utilizza cookie. Cliccando fuori dal banner, scrollando o continuando la navigazione in qualsiasi modo acconsenti all'utilizzo dei questi cookie. <a href="http://emadion.it/informativa-privacy-per-i-cookie/\" target="_blank">Leggi l'informativa completa</a><br /><br />This site uses cookies. Information about your use of this site may be shared with third parties. By using this site, you agree to our use of cookies. <a href="http://emadion.it/informativa-privacy-per-i-cookie/\" target="_blank">Learn more</a>'
+''
+'</div>',
cookieDuration: 365000,
eventScroll: true,
scrollOffset: 20,
clickOutside: true,
cookieName: 'ginger-cookie',
forceReload: true,
iframesPlaceholder: true,
iframesPlaceholderClass: 'ginger-iframe-placeholder',
iframesPlaceholderHTML:
document.getElementById('ginger-iframePlaceholder-html') !== null ?
document.getElementById('ginger-iframePlaceholder-html').innerHTML :
'

This website uses cookies.'
+'Ho capito - Got it'
+'</p>'
});
</script>

Problemi con Google Analytics

Ciao,
sto utilizzando cookies-enabler.js su www.venicealbum.com dove utilizzo Universal Analytics. Google Tag Assistant per Chrome riporta un problema per l'utilizzo di un doppio codice Analytics, anche se così non è. Ti riporto qui sotto uno screenshot.

Sembra essere un conflitto tra i due sistemi, potresti gentilmente verificare?

Grazie,
Tiziano

schermata 2015-10-22 alle 14 59 33

Disabilitare Video YouTube/Viemo e Google Maps

Ciao, potresti aggiungere nello script l'abilitazione degli iframe convertendo la proprietà display: block; (ovviamente da css iniziale imposteremo display: none; ) ? Così siamo a posto anche con video embeddati e Google Maps. Grazie

IE8 compatibility bug

Buongiorno, ho installato lo script, ma ho notato che non funziona su ie8.
Non riesco a capire perché, ma mi da errore:

Proprietà o metodo non supportati dall'oggetto: linea 355 carattere 13

Cordiali saluti.

Problema con Google Analytics

Da quando c'è stato l'aggiornamento che ha permesso di disabilitare gli iframe, sia Google Analytics che Facebook hanno smesso di funzionare (non appaiono più nonostante abbia accettato i cookie). Ho notato questo problema anche nella vs demo allegata. È normale oppure c'è da fare altro?

iframes.get

When I accept cookies script work and frames is visible, but if I return in the page frames are hide.
The problem is in get function. First n = iframes.length is 1, second time is 0.
But I can't find the problem

Disattivazione cookie dopo accettazione

Ciao prevedete di implementare un sistema tipo quello di fiat.it?
Ovvero la possibilità di disattivarei cookie in qualsiasi momento? (fiat permette di farlo non per singoli cookie, ma per 3 grandi gruppi in cui li ha suddivisi)

Create package on npm

Is it possibile to have this package available on npm? Bower isn't in our workflow, so we'd like not to use it just for this, but we'd also like to have a versioned and easy-to-upgrade package.

Sarebbe possibile mettere questo pacchetto su npm? Bower non è nel nostro workflow, quindi non vorremmo usarlo solo per questo, ma ci piacerebbe anche poter usare un modulo versionato e facile da aggiornare.

Seo

Is it possibile enable cookies to Googlebot and not index banner?

example:
< ! -- googleoff: index -- >
Banner
< ! -- googleon: index -- >

Click

Ciao, è possibile disabilitare il click con il tasto destro?

enable cookies by click

Great work!
I noticed that if I click the link of Privacy Policy are enabled the cookies. Is it possible exclude the link of Privacy Policy?

PS
Dimmi di dove sei e hai una birra pagata!

Problema con eventScroll

Ho messo eventScroll: true tra le opzioni del plugin sul sito www.cloudprivato.com ma ho notato una cosa...il banner resta solo se si è in cima alla pagina, mentre se per caso ricarico il sito trovando in mezzo oppure arrivandoci da un'ancora scompare praticamente subito.
E' normale?

License clarification

Hi,

unfortunately I could not find any license hint in your repository anywhere. Could you kindly clarify the license your code is published under?

Elenco feature

Salve,
è possibile avere un elenco delle feature che pensate di implementare?
Consigliate di usare lo script già allo stato attuale?

grazie

Problems with Google Maps Javascript API?

Hi,
I'm developing a new website using cookies-enabler and it work pretty well, as usual for youtube iframes, Google analytics and Google recaptcha scripts.

But in the contact page of this website I need to use the Google Javascript API to create a map with two marker and other personalizations and it won't work with cookies-enabler.

I've also tried to use postscribe as described in the documentation, but nothig, it won't works.

This is the code I'm using:

`

  | <script data-ce-src="https://maps.googleapis.com/maps/api/js?key=XXXXXXXXX" class="ce-script"></script>
  | <script class="ce-script">
  |  
  | var initialize = function() {
  |  
  | // DEFINISCE LE COORDINATE
  | var latlngCentro = new google.maps.LatLng(43.765182,11.250273);
  |  
  | // CREA LA MAPPA
  | var options = {
  | scrollwheel: false,
  | zoom: 14,
  | center: latlngCentro,
  | mapTypeId: google.maps.MapTypeId.ROADMAP
  | };
  |  
  | var map = new google.maps.Map(document.getElementById('map'), options);
  | window.onload = initialize;
  | </script>
  |  
  |
  | <script src="postscribe/src/postscribe.js"></script>
  | <script src="cookies-enabler/cookies-enabler.js"></script>
  | <script>
  | COOKIES_ENABLER.init({
  | scriptClass: 'ce-script',
  | iframeClass: 'ce-iframe',
  |  
  | acceptClass: 'ce-accept',
  | dismissClass: 'ce-dismiss',
  | disableClass: 'ce-disable',
  |  
  | bannerClass: 'ce-banner',
  | bannerHTML:
  | '

Lorem ipsum dolor sit amet '
  | +''+'cookie policy'+'.

'
  | +'

Lorem ipsum dolor sit amet '
  | +''+'Ok'+'

',
  |  
  | eventScroll: false,
  | scrollOffset: 200,
  |  
  | clickOutside: false,
  |  
  | cookieName: 'ce-cookie',
  | cookieDuration: '365',
  |  
  | iframesPlaceholder: true,
  | iframesPlaceholderHTML:
  | '

Lorem ipsum dolor sit amet '
  | +'Ok'
  | +'

',
  | iframesPlaceholderClass: 'ce-iframe-placeholder',
  |  
  | // Callbacks
  | onEnable: '',
  | onDismiss: '',
  | onDisable: ''
  | });
  | </script>
`
The chrome console says:

Uncaught ReferenceError: google is not defined at initialize (contatti.php:352)

Anyone has any suggestion to fix this problem, please?

Reopen Banner Cookie Advice

C'è un modo per far ricomparire il banner di avviso cookie ?

Ad esempio un cliente decide di rifiutare l'utilizzo dei cookie. Vorrei dare la possibilità (come con servizi alla cookiebot), cliccando su un link di far comparire nuovamente il banner e attivare l'utilizzo dei cookie.

Grazie!

There is a way to reopen cookie banner adw also if user click accept or dissmis link class?

Postscribe question

Hi! Great SW, thanks for your hard work!
I have one question: On line 431 it looks like the script tries to use postscribe exactly in cases postscribe is not defined. Looks like a mistake to me. Shouldn't it be:

if (typeof postscribe !== "undefined"){
    postscribe(...);
}

instead of the current:

if (typeof postscribe === "undefined"){
    postscribe(...);
}

?

banner not recognized

Ciao Nicholas, ho provato il tuo plugin che sembra essere quello più vicino alle direttive del garante della privacy italiano.
Ho un problema di banner non trovato alla riga 225 di cookies-enabler.js:
Uncaught TypeError: Cannot read property 'style' of undefined
dismiss
(anonymous function)
window.COOKIES_ENABLER.window.COOKIES_ENABLER.later

quando si fa un'azione che dovrebbe far scomparire il banner e accettare i cookie il banner sembra non sia definito
domElmts.banner[0].style.display = 'none';

Inoltre cliccando su link presenti nella pagina ma non appartenenti a elementi generati dallo script i cookie non vengono accettati pur avendo settato clickOutside: true

ecco la mia config:
COOKIES_ENABLER.init({
scriptClass: 'ce-script',
iframeClass: 'ce-iframe',

acceptClass: 'ce-accept',
dismissClass: 'ce-dismiss',
disableClass: 'ce-disable',

bannerClass: 'ce-banner',
bannerHTML: '<p>questo sito utilizza i cookie propri e di terze parti per garantire una migliore esperienza sul sito e per la profilazione delle scelte dell’utente.<br>Utilizzando questo sito acconsenti al loro uso. <a href="cookie-policy.php">Ulteriori informazioni</a></p>',

eventScroll: true,
scrollOffset: 10,

clickOutside: true,

cookieName: 'ce-cookie',
cookieDuration: 365,

preventIframes: true,
iframesPlaceholder: true,
iframesPlaceholderHTML: '<p>Per vedere questo contenuto devi <a href="#" class="ce-accept">Accettare i cookie</a></p>',
iframesPlaceholderClass: 'ce-iframe-placeholder',

});

grazie

Scripts blocked on further website visits

Hello!

I tried this script, it works well.
I noticed an issue.
When I go back on the website (please note clicked on the banner or scrolled in the page in the previous website visit) all scripts are blocked and not visible, such as Facebook box, Adsense, etc..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.