PageSourceSearch

https://cr-koeln.de/assets/js/klaro-init.js

js cr-koeln.de collected 2026-10-07 04:55:14 UTC 1,692 bytes, 54 lines download raw bytes

1(function () {
2    function klaroHasConsentDecision() {
3        if (klaroConfig.storageMethod === 'cookie') {
4            return document.cookie.split('; ').some(function (c) {
5                return c.indexOf(klaroConfig.cookieName + '=') === 0;
6            });
7        }
8
9        if (klaroConfig.storageMethod === 'localStorage') {
10            try {
11                return localStorage.getItem(klaroConfig.cookieName) !== null;
12            } catch (e) {
13                return false;
14            }
15        }
16    }
17
18    function klaroInit() {
19        if (!window.klaro || typeof klaroConfig === 'undefined') return;
20
21        klaro.render(klaroConfig, {show: false});
22
23        if (klaroHasConsentDecision()) return;
24
25        var klaroShown = false;
26        var klaroShowEvents = ['click', 'keydown', 'scroll', 'wheel'];
27
28        function showKlaroBanner(e) {
29            if (klaroShown || klaroHasConsentDecision()) return;
30            klaroShown = true;
31
32            if (e && e.cancelable) e.preventDefault();
33            if (e && typeof e.stopImmediatePropagation === 'function') {
34                e.stopImmediatePropagation();
35            }
36
37            klaroShowEvents.forEach(function (name) {
38                window.removeEventListener(name, showKlaroBanner, {capture: true});
39            });
40
41            document.body.classList.add('klaro-show-notice');
42        }
43
44        klaroShowEvents.forEach(function (name) {
45            window.addEventListener(name, showKlaroBanner, {capture: true, passive: false});
46        });
47    }
48
49    if (document.readyState === 'loading') {
50        document.addEventListener('DOMContentLoaded', klaroInit);
51    } else {
52        klaroInit();
53    }
54})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.