PageSourceSearch

https://fair-impact.eu/modules/custom/trust_ppg/js/classes/Cookies.js?v=1.x

js fair-impact.eu collected 2026-10-02 07:24:38 UTC 1,002 bytes, 45 lines download raw bytes

1let cookieController;
2
3const Cookies = class Cookies {
4  consentCookie;
5
6  constructor() {
7    cookieController = this;
8  }
9
10  /**
11   * Extracts and sets the ppgm cookie or an empty string to `this.consentCookie`.
12   */
13  refreshCurrentConsent() {
14    cookieController.consentCookie = cookieController.extractConsentCookie();
15  }
16
17  extractConsentCookie() {
18    const foundCookie =
19      cookieController.extractAllCookies().trust_ppgm_consent ?? {};
20
21    if (!foundCookie.length) {
22      return foundCookie;
23    }
24
25    let parsedCookies;
26
27    try {
28      parsedCookies = JSON.parse(foundCookie);
29    } catch (error) {
30      if (error instanceof SyntaxError) {
31        parsedCookies = JSON.parse(unescape(foundCookie));
32      }
33    }
34
35    return parsedCookies ?? {};
36  }
37
38  extractAllCookies() {
39    return document.cookie.split(";").reduce((cookies, cookie) => {
40      const [name, value] = cookie.split("=").map((c) => c.trim());
41      cookies[name] = value;
42      return cookies;
43    }, {});
44  }
45};

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.