PageSourceSearch

https://www.friedenweiler.de/_assets/68bd152eb8a807512de054076d8e1…/Dist/cookieconsent.js?1705401086

js friedenweiler.de collected 2026-10-02 20:36:43 UTC 1,240 bytes, 53 lines download raw bytes

1const CookieConsentStorageKey = 'cookieconsent';
2
3const CookieConsentDefault = {
4    essential: false,
5    external: false
6};
7
8
9const getCookiePreferences = () => {
10
11    const storedPreferences = localStorage.getItem(CookieConsentStorageKey);
12    
13    return {
14        ...CookieConsentDefault,
15        ...(storedPreferences ? JSON.parse(storedPreferences) : {})
16    }
17}
18
19const setCookiePreferences = (preferences = {}) => {
20
21    const currentPreferences = getCookiePreferences();
22
23    localStorage.setItem(
24        CookieConsentStorageKey,
25        JSON.stringify({
26            ...currentPreferences,
27            ...preferences
28        })
29    )
30}
31
32const clearCookiePreferences = () => {
33    localStorage.removeItem(CookieConsentStorageKey);
34}
35
36
37const showCookieConsent = () => {
38    const cookieConsent = document.getElementById('cookieconsent');
39    cookieConsent?.showModal();
40}
41
42
43window.addEventListener('DOMContentLoaded', () => {
44
45    document.querySelector('#cookieconsent button[type=submit]')?.addEventListener('click', () => setCookiePreferences({essential: true}));
46
47    const {essential} = getCookiePreferences();
48
49    if(!essential) {
50        showCookieConsent();
51    }
52    
53})

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.