PageSourceSearch

https://xn--santibaezdeesgueva-t0b.es/modules/contrib/cookies/modules/cookies_ga/js/cookies_ga.js?v=10.2.7

js xn--santibaezdeesgueva-t0b.es collected 2026-10-02 21:33:10 UTC 1,452 bytes, 48 lines download raw bytes

1/**
2 * @file
3 * Defines Javascript behaviors for the cookies module.
4 */
5(function (Drupal) {
6  'use strict';
7
8  /**
9   * Define defaults.
10   */
11  Drupal.behaviors.cookiesGa = {
12
13    consentGiven: function () {
14      var scriptIds = [
15        'cookies_ga_ga',
16        'cookies_ga_ga_debug',
17        'cookies_ga_google_analytics_tracking_script',
18        'cookies_ga_google_analytics_tracking_file',
19      ];
20      for (var scriptId in scriptIds) {
21        var script = document.getElementById(scriptIds[scriptId]);
22        if (script) {
23          var content = script.innerHTML;
24          var newScript = document.createElement('script');
25          var attributes = Array.from(script.attributes);
26          for (var attr in attributes) {
27            var name = attributes[attr].nodeName;
28            if (name !== 'type' && name !== 'id') {
29              newScript.setAttribute(name, attributes[attr].nodeValue);
30            }
31          }
32          newScript.innerHTML = content;
33          script.parentNode.replaceChild(newScript, script);
34        }
35      }
36    },
37
38    attach: function (context) {
39      var self = this;
40      document.addEventListener('cookiesjsrUserConsent', function (event) {
41        var service = (typeof event.detail.services === 'object') ? event.detail.services : {};
42        if (typeof service.analytics !== 'undefined' && service.analytics) {
43          self.consentGiven(context);
44        }
45      });
46    }
47  };
48})(Drupal);

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.