Alex-D/Cookies-EU-banner

Does not seem to be invoked / initialiazed

chrissound opened this issue · 4 comments

I've tried two browsers.

How I've installed this:
I've downloaded the zip, and copied over the Cookies-EU-banner-master/src/cookies-eu-banner.js file.
I've added a script tag to source this file to my page, as well as add the relevant banner.

However the banner does not get shown, if I remove the display:none css property it gets shown but clicking any of the buttons doesn't do anything.

How can I verify the code is being correctly invoked?

}(window, function () {
  'use strict';
    console.log("14");
  var CookiesEuBanner,
    document = window.document;

  CookiesEuBanner = function (launchFunction, waitAccept, undefined) {
    if (!(this instanceof CookiesEuBanner)) {
      return new CookiesEuBanner(launchFunction);
    }

    this.cookieTimeout = 33696000000; // 13 months in milliseconds
    this.bots = /bot|googlebot|crawler|spider|robot|crawling/i;
    this.cookieName = 'hasConsent';
    this.trackingCookiesNames = [ '__utma', '__utmb', '__utmc', '__utmt', '__utmv', '__utmz', '_ga', '_gat' ];
    this.launchFunction = launchFunction;
    this.waitAccept = waitAccept || false;
    console.log("29");
    this.init();
    console.log("31");
  };

Only get "14" in the console output, so this function does not seem to be run?

It seem it's missing a CookiesEuBanner().init() somewher?

It seems to me necessary to actually call new CookiesEuBanner(); on the page. It would be useful to mention this in the readme, as it's not obvious that it's strictly required.