From 2725d56c39f07bceab9138bba27f04c88d3b6352 Mon Sep 17 00:00:00 2001 From: Stanislav Date: Mon, 26 May 2025 14:01:16 +0300 Subject: [PATCH] Update event listener to use DOMContentLoaded Replaced the 'load' event with 'DOMContentLoaded' to ensure the cookie consent initialization runs as soon as the DOM is fully loaded, without waiting for additional resources. This improves performance and reduces potential delays in script execution. --- resources/js/Cookies.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/Cookies.js b/resources/js/Cookies.js index 44ed21a..9dfb30f 100644 --- a/resources/js/Cookies.js +++ b/resources/js/Cookies.js @@ -84,6 +84,6 @@ class LaravelCookieConsent { } } -window.addEventListener('load', () => { +window.addEventListener('DOMContentLoaded', () => { window.LaravelCookieConsent = new LaravelCookieConsent({ config: 1 }); }); \ No newline at end of file