GithubHelp home page GithubHelp logo

tox82 / cookie-bar Goto Github PK

View Code? Open in Web Editor NEW
173.0 18.0 117.0 408 KB

cookieBAR is a free & easy solution to the EU cookie law.

Home Page: https://cookie-bar.eu/

License: GNU General Public License v2.0

JavaScript 8.36% CSS 22.23% HTML 69.41%
cookie cookie-banner-javascript cookie-consent cookie-bar

cookie-bar's Introduction

cookieBAR

Rate on Openbase

cookieBAR is a free & easy solution to the EU cookie law.

Why use cookieBAR?

There is a lot of mystery and fuss surrounding the new EU cookie legislation, but it's essentially really simple. Cookies are files used to track site activity and most websites use them. Site owners need to make the use of cookies very obvious to visitors.

Cookie bar makes it simple and clear to visitors that cookies are in use and tells them how to adjust browser settings if they are concerned.

TL;DR

Get to this page, configure the cookiebar to your needs and place the generated code somewhere in your web pages:

https://cookie-bar.eu/#configuration

How it works?

cookieBAR is a drop-in and forget, pure vanilla javascript plugin, with no jQuery nor any other dependency needed. It shows up when needed and stay silent when not: if a website has a cookie or some localStorage data set then the bar is shown, otherwhise nothing happens.

Once user clicks Allow Cookies cookieBAR will set a cookie for that domain with a name cookiebar that will expire in 30 days. What this means is that the plugin will only show up once month (this duration is configurable).

If a user decides to click Disallow Cookies, cookieBAR will simply remove all cookies and localStorage data (and will show up again the first time a cookie is detected).

Having a cookiebar cookie makes it simple to developers to check the user decision before activating external scripts (such as Google Analytics, or anything else). See https://cookie-bar.eu for more informations.

cookie-bar's People

Contributors

4mtrade avatar adsidera avatar alexxiv avatar bricebou avatar commander238 avatar d9ping avatar dan-szabo avatar eddy2909 avatar emanuelcanuto avatar ezzyfezzy avatar frantique avatar geolim4 avatar hexodus avatar hrvoj3e avatar jacmaes avatar jmaleman avatar lucarainone avatar lukasdrgon avatar marcceleiro avatar martinkolarik avatar mejans avatar michael-simons avatar mikaeluu85 avatar mzog avatar pinhead84 avatar sychova-fh avatar timoleon avatar tox82 avatar utilsites avatar xterr 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

cookie-bar's Issues

Generator on web uses wrong language code for Czech

The web configurator uses wrong two-letter code for forcing Czech language. As a result, an English version of the bar is shown. It simply needs to use cs instead of cz.

Actual: forceLang=cz
Desired: forceLang=cs

Error on link

For this links

  • …the_guide/cookies(ico.org.uk) | _blank | nofollow
  • …answer/61416?hl=en(support.google.com) | _blank | nofollow
  • …kb/enable-and-disable-cookies-website-preferences(support.mozilla.org) | _blank | nofollow
  • …internet-explorer/delete-manage-cookies(windows.microsoft.com) | _blank | nofollow
  • …en/cookies.html(help.opera.com) | _blank | nofollow
  • /kb/PH17191?viewlocale=en_GB

To improve performance and prevent security vulnerabilities links must have a rel="noopener" or rel="noreferrer" to any external links.

Execution moment of blocking / preventing services

Hi,

Looking at the 'Preventive block' tab on the website, is see the option to verify setting of the cookie with f.i.:

<?php
if ($_COOKIE['cookiebar'] == "CookieAllowed") {
    // The user has allowed cookies, let's load our external services
}
?>

When is this script executed? As soon as the visitor hit the 'accept' button or when the same visitors visits the site within the time the cookie is valid?

Thanks.

GDPR-compliance / GeoIP - Auto Opt-In for non-EEA visitors.

I am currently using cookie-bar on my website to prevent AdSense ads from showing, because this is required to comply with the AdSense TOS. Because my ads are Opt-In now for all customers, this has largely impacted my page's ad revenue. A large part of my visitors is based in the US and India, so they are not affected by the GDPR and I could show them ads without requiring consent.

Unfortunately, right now cookie-bar is either always showing (no GeoIP) or only showing for EEA visitors (GeoIP). In the latter case, if I want to check if the Opt-In cookie has been set by cookie-bar, this would obviously fail, because cookie-bar has never been loaded, thus no cookie has been set.

I would now have to use an additional GeoIP plugin to determine the visitors location, but since cookie-bar already does GeoIP identification, it would be easiest if cookie-bar still sets the CookieAllowed cookie if the GeoIP verification determined that the visitor is located outside of the EEA, i.e. Opt-In for all non-EEA visitors. I'll gladly help implementing this feature.

Errors in czech translation

Hi,
I have found three errors in the Czech translation (cs.html).
Here is the correct spelling.

Line 10 (1 word modified)
English: "This website makes use of third party cookies, see the details in the privacy policy."
Correct translation: "Tato webová stránka používá cookies třetích stran, viz podrobnosti v zásadách ochrany osobních údajů."

Line 14 (1 word modified)
English: "This website makes use of tracking cookies, see the details in the privacy policy."
Correct translation: "Tato webová stránka používá sledovací cookies, viz podrobnosti v zásadách ochrany osobních údajů."

Line 45 (2 words modified)
English: "Privacy policy"
Correct translation: "Zásady ochrany osobních údajů"

Ripristino spazio

Dopo la chiusura della barra rimane lo spazio precedentemente occupato da questa.

Please provide minified version for jsDelivr

I noticed this lib get auto updated into jsDelivr but there is no minified version.

Please consider offering a minified version for CDN hosting.
Using uglifyjs, there is almost a 50% saving in file size.

cookiebar-latest.js: 11464 bytes
cookiebar-latest.min.js: 6680 bytes

Geolocalizzazione

Geolocalizzazione dei soli paesi afflitti dalla normativa, quindi escludere il resto del mondo dalla visualizzazione della barra.

Delete cookies at every refresh if a user declines?

As the cookie law states, if a use declines the use of cookies the website, it should not install any of them on his terminal.

This is impossible to do with a javascript solution, but it could be feasible to delete them AFTER they are set, at every refresh.

Could this be a (partial) solution?

FreeGeoIP will be no longer Free. What can we switch to?

The FreeGeoIP team has announced that their API will be discontinued starting from the 1st of July 2018. They are switching to a new geoip service but the free plan will have a 10.000 request limit, so it's not viable for cookiebar. Moreover, an API Key would be needed and I'd like to avoid it.

Do you know another similar service that cookiebar could use? TBH we wouldn't even need precise geolocation, as the cookiebar only needs to detect the user's country code.

Here are some free services that I've found:

http://ip-api.com/
http://geoip.nekudo.com/
...

Any suggestions?

Snippet to check cookie value throws error

The snippet

 cookieValue = document.cookie.match(/(;)?cookiebar=([^;]*);?/)[2];

throws error Uncaught TypeError: Cannot read property '2' of null when cookiebar cookie is not present in Chrome 74.0.3729.108

I'd suggest to change that to the following:

let matches = document.cookie.match(/(;)?cookiebar=([^;]*);?/);
let cookieValue = Array.isArray(matches) ? matches[2] : '';

note this may not be compatible with older browsers...

Not showing on certain devices?

The cookie bar is not displaying on certain devices:

Microsoft Surface, Windows 10, Chrome
iphone 6 ios 12.1

And Microsoft Surface using explorer closes the cookie bar when using the browser back button?

Possibilità di mostrare la barra in assenza di cookie

Avvio della Cookiebar anche in assenza di Cookies.
Ritorno della Cookiebar al riconoscimento di Cookies anche dopo l'accettazione, quindi eliminare i 30 giorni.
Aggiunta dei link alle Policy per servizi di terze parti tipo Adsense, Analitics, Addthis...

Doesn't seem to work in Chrome browser on OSX

75.0.3770.100 (Official Build) (64-bit)
OSX 10.14.5.

Banner disappears in Safari And Firefox and remembers the choice. Doesn't seem to work in Chrome browsers. Every refresh, the banner reappears.

Attempting to implement:

cookieValue = document.cookie.match(/(;)?cookiebar=([^;]*);?/)[2]; if (cookieValue == 'CookieAllowed') {

The if statement never is entered on Chrome. Works fine in Firefox and Safari.

Update:
Chrome has local cookie setting issues. Once published, the code works fine.

HTTPS

Hi Again !

sorry for all these issues. The Chrome Developer Console brings up this error message:

"URL" was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.telize.com/geoip'. This request has been blocked; the content must be served over HTTPS.

bg translation add

Hello, could anybody add the file attached to the lang folder? It's Bulgarian translation. I'm not good in working with github.
bg.zip

Errors in French translation

Great script, but the French translation could be much improved with a few quick changes. As a native speaker, here are my suggested changes:

  • Line 7 and 8:
    Ce site utilise des cookies pour améliorer l'expérience de navigation et fournir des fonctionnalités supplémentaires. Ces données ne seront pas utilisées pour vous identifier ou vous contacter.
  • Line 11 and 15:
    (...) la politique (...)
  • Line 19:
    Pour savoir comment ce site utilise les cookies ou la technologie du localStorage, lisez notre politique de confidentialité.
  • Line 21:
    (...) vous consentez à ce que ce site sauvegarde (...)
  • Line 26:
    Pour en savoir plus sur les cookies et le localStorage, visitez le site de la (...)
  • Line 45:
    Ce site utilise des cookies pour améliorer l'expérience de navigation et fournir des fonctionnalités supplémentaires.
  • Line 46:
    En savoir plus (instead of "Détails")

generator does not correctly escape the script URL

My HTML editor complains about the HTML snippet, that was created with your generator at cookie-bar.eu. For example the snippet

<script type="text/javascript" src="//cdn.jsdelivr.net/cookie-bar/1/cookiebar-latest.min.js?forceLang=de&theme=grey&tracking=1&remember=100&privacyPage=%2Fprivacy"></script>

does not have a correctly escaped URL. I guess correct should be:

<script type="text/javascript" src="//cdn.jsdelivr.net/cookie-bar/1/cookiebar-latest.min.js?forceLang=de&amp;theme=grey&amp;tracking=1&amp;remember=100&amp;privacyPage=%2Fprivacy"></script>

GDPR compliance

Are there plans to comply with GDPR by 25th May 2018? I see IT Governance have written an article about GDPR affects Cookie Policies here.

Will there be an option to revoke consent?

cookieBAR always showing

Maybe I'm understanding this wrong, but on the website the plugin is listed as:

It shows up when needed and stay silent when not: If a website has some cookies or localStorage data set then the bar is shown, otherwhise nothing happens.

For testing purposes I hosted a empty HTML file with nothing except the code produced by the configurator:

<!-- test.html -->
<script src="https://cdn.jsdelivr.net/npm/cookie-bar/cookiebar-latest.min.js?forceLang=de&noGeoIp=1&top=1&hideDetailsBtn=1"></script>

But for some reason I still get the cookie notice no matter what. I would have thought that the bar would now be hidden unless I would set a cookie before.

Uncaught exception if cookies are turned off in browser

Hi,
I want to use your plugin on my website, because i like the functions and design. :)
Today I have found some errors, which occur, if the user has switched the cookies off in his browser settings.
The problem occurs while reading "window.localStorage".
Chrome ... accessing window.localStorage throws an exception
Firefox ... reading window.localStorage returns null and then throws an exception
I suggest, you fix this by adding a try-catch block and checking for null.
(Chrome ... chrome://settings/content ; Firefox ... about:preferences#privacy )
Thank you in advance.

Version 1.6.2 causes multiple page requests

Hi,

I've used version 1.5.33 in the past without any issues. After switching to version 1.6.2, each page containing the cookieBar script is processed at least twice or sometimes three times. It looks like multiple requests are being executed. If I use version 1.5.33 everything is ok. I use the following parameters: forceLang=de&tracking=1&always=1&noGeoIp=1&top=1&privacyPage=Privacy.html

Does anyone have any idea what might be causing this?

HTTPS

Please change in configurator

<script type="text/javascript" src="http://cdn.jsdelivr.net/cookie-bar/1/cookiebar-latest.js"></script>

to:

<script type="text/javascript" src="//cdn.jsdelivr.net/cookie-bar/1/cookiebar-latest.js"></script>

So it will work with HTTP and HTTPS, thanks

Language should not be the only reason to display additional information

When the cookie Bar is displayed in French, the additional information is from "fr.html" -- however, this page includes a link to http://www.cnil.fr/vos-obligations/sites-web-cookies-et-autres-traceurs/ -- Commission Nationale de l'Informatique et des Libertés.
So, while that is right for France, it is not correct for Belgium where the links should point to the "Commission de la protection de la vie privée" or "Commissie voor de bescherming van de persoonlijke levenssfeer" (in English: Commission for the Protection of Privacy).
See information on cookieBAR.eu website: Legal Reading

I think that the Legal Reading link should probably be based on the country where the person is located (similar to GET: //freegeoip.io/json/) -- of course, this is defeated by VPN users, but that is another problem.

Cookie-bar doesn't work with Bootstrap theme

It seems Cookie Bar doesn't show up on a popular Bootstrap Theme (Twitter Bootstrap theme); my website is Drupal 7, Cookie bar used to work and still works with another theme, but I recently switched to Bootstrap theme and it doesn't work, if I change theme back, it shows.....

Bootstrap theme is also using cdn.jsdelivr.net;
Cookie-Bar-Master - I have downloaded locally long time ago in a separate folder; it used to work, but now I don't know what to do...

Timeouts

Hi!

telize is also timing out most of the time.

Confirming Cookie-Bar is working.

Cloned the repository in the project and referenced the "cookiebar-latest.min.js" file in the script tag.
How can I confirm that the script is working 100%?

Thanks

"privacy policy" link sits next to "details" link without separation

When a custom Privacy policy page is configured, the link to this page is place right next to the existing Details link without a clear separation between the two. Without hovering with the mouse it is unclear that there are two links present. Additionally the bar reads awkwardly due to the two phrases not being separated.

image

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.