ToX82 / cookie-bar

cookieBAR is a free & easy solution to the EU cookie law.
https://cookie-bar.eu/
GNU General Public License v2.0
172 stars 117 forks source link

Using cookie-bar as npm module (as opposed pulling from CDN) #112

Open thedotedge opened 4 years ago

thedotedge commented 4 years ago

Is there any way to use cookie-bar as browser npm dependency (i. e. in webpack bundle), without pulling it from CDN?

Looks like the config always gets parameters from the URL and it's not possible to pass them as a configuration object setupCookieBar().

ToX82 commented 4 years ago

Hello @thedotedge cookiebar is indeed intended to be configured through the script url, like this:

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/cookie-bar/cookiebar-latest.min.js?always=1&top=1"></script>

I'm afraid that configuring it through other methods is not currently possible. It would be a nice addition though, and it shouldn't be that difficult to implement.

I will definitely look into it, but if you wish to contribute with a PR I'd be very happy to merge it.