PageSourceSearch

https://www.garnelio.de/custom/plugins/DIScoGA4S5/Resources/js/main.js?six_jsfix=20260923

js garnelio.de collected 2026-10-02 11:01:49 UTC 2,054 bytes, 71 lines download raw bytes

1// Import all necessary Storefront plugins
2import GA4Plugin from './ga4/ga4.plugin.js?six_jsfix=20260923';
3
4function initPlugin () {
5    (function($) {
6        if (!window.ga4Enabled) {
7            return;
8        }
9
10        if (typeof $.subscribe === 'undefined') {
11            var o = $({});
12
13            $.subscribe = function () {
14                o.on.apply(o, arguments);
15            };
16
17            $.unsubscribe = function () {
18                o.off.apply(o, arguments);
19            };
20
21            $.publish = function () {
22                o.trigger.apply(o, arguments);
23            };
24        }
25
26        (new GA4Plugin()).init();
27    }(jQuery));
28}
29
30function initPluginWithLoadedJquery() {
31    const script = document.createElement('script');
32    script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js';
33    script.setAttribute(
34        'integrity', 'sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f'
35    );
36    script.setAttribute('crossorigin', 'anonymous');
37    script.onload = function () {
38        initPlugin();
39    };
40    document.head.appendChild(script);
41}
42
43function runDelayedInitialization() {
44    const maxWatcherAttempts = 30;
45    let watcherAttempts      = 0;
46    const jQueryLoadWatcher = setInterval(() => {
47        const isJqueryMissing = (typeof window.jQuery === 'undefined' && typeof window.$ === 'undefined');
48        if (watcherAttempts > maxWatcherAttempts) {
49            console.warn(
50                'Failed to load default Shopware jQuery library. Loading specifically as required by plugin'
51            );
52            clearInterval(jQueryLoadWatcher);
53            initPluginWithLoadedJquery();
54            return;
55        }
56
57        if (isJqueryMissing) {
58            watcherAttempts++;
59            return;
60        }
61
62        clearInterval(jQueryLoadWatcher);
63        initPlugin();
64    }, 200);
65}
66
67if (typeof window.jQuery === 'undefined' && typeof window.$ === 'undefined') { // This is for "async" loading...
68    runDelayedInitialization();
69} else {
70    initPlugin();
71}

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.