From aecc6915ae8a0ca3f729c2f3287e9faf64580c7d Mon Sep 17 00:00:00 2001 From: Lucie Bader <167515375+Lucie-Bdr@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:54:32 +0100 Subject: [PATCH] Correction mode beug/prod --- manifest.json | 11 ----------- src/utils/logger.js | 9 +++++++-- src/utils/stats.js | 3 ++- src/workers/pyodide_worker.js | 1 + 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/manifest.json b/manifest.json index d465f43..120ad98 100644 --- a/manifest.json +++ b/manifest.json @@ -38,11 +38,6 @@ "default_title": "ff2BaLex" }, - "options_ui": { - "page": "src/options/options.html", - "open_in_tab": false - }, - "sidebar_action": { "default_title": "BaLex", "default_panel": "src/sidebar/sidebar.html", @@ -64,13 +59,7 @@ "src/utils/stats.js"], "css": ["src/context_menu/custom_context_menu.css"], "run_at": "document_idle" - }, - { - "matches": ["<all_urls>"], - "js": ["src/utils/stats.js"], - "run_at": "document_end" } - ], "web_accessible_resources": [ diff --git a/src/utils/logger.js b/src/utils/logger.js index e4907fd..79a5229 100644 --- a/src/utils/logger.js +++ b/src/utils/logger.js @@ -1,12 +1,17 @@ - /** * Mode debug : affiche les logs dans la console * Mode prod : masque les logs ainsi que les identifiants des lexiques */ -const DEBUG = false; // false en prod +const DEBUG = true; // false en prod function log(...args) { if (DEBUG) { console.log(...args); } } + +if (typeof window !== 'undefined') { + window.log = log; +} else if (typeof self !== 'undefined') { + self.log = log; +} diff --git a/src/utils/stats.js b/src/utils/stats.js index fd2c702..c86ddb8 100644 --- a/src/utils/stats.js +++ b/src/utils/stats.js @@ -1,4 +1,5 @@ (function () { + if (window.hasRun) { return; } @@ -310,7 +311,7 @@ rect.setAttribute("stroke-width", "0.5"); rect.setAttribute("stroke-dasharray", "200 200"); rect.setAttribute("stroke-dashoffset", "400"); - rect.style.animation = "dashAnimation 8s ease-in-out infinite"; + rect.style.animation = "dashAnimation 6s ease-in-out infinite"; svg.appendChild(rect); document.body.appendChild(svg); diff --git a/src/workers/pyodide_worker.js b/src/workers/pyodide_worker.js index 246c47f..45f9e77 100644 --- a/src/workers/pyodide_worker.js +++ b/src/workers/pyodide_worker.js @@ -1,3 +1,4 @@ +importScripts("../utils/logger.js"); log("✅ pyodide_worker.js chargé avec succès !"); // URL de la version Pyodide la plus récente -- GitLab