diff --git a/plugin/plugin_chrome/content.js b/plugin/plugin_chrome/content.js index 8007467..9f996f6 100644 --- a/plugin/plugin_chrome/content.js +++ b/plugin/plugin_chrome/content.js @@ -1,11 +1,11 @@ -// Plugin DIMA - Version simplifiée et robuste +// Plugin DIMA - Version avec fichiers PNG const DIMA_TECHNIQUES = [ // PHASE DETECTER { index: "TE0111", nom: "Heuristique de disponibilité", phase: "Detect", - mots_cles: ["récent", "recently", "exemple", "example", "cas", "case", "témoignage", "testimony"] + mots_cles: ["récent","disponible", "recently", "exemple", "example", "cas", "case", "témoignage", "testimony"] }, { index: "TE0112", @@ -199,7 +199,6 @@ class DIMAAnalyzer { init() { console.log('DIMA: Initialisation...'); - // Attendre que la page soit prête if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { this.delayedInit(); @@ -210,7 +209,6 @@ class DIMAAnalyzer { } delayedInit() { - // Attendre un peu plus pour que la page soit complètement chargée setTimeout(() => { try { this.analyzeCurrentPage(); @@ -228,7 +226,6 @@ class DIMAAnalyzer { const textElements = document.querySelectorAll('p, h1, h2, h3, article, .content, .article-content'); let content = ''; - // Extraire le texte de manière sécurisée for (let i = 0; i < Math.min(textElements.length, 10); i++) { const element = textElements[i]; if (element && element.textContent) { @@ -237,7 +234,6 @@ class DIMAAnalyzer { } content = content.substring(0, 1500); - console.log('DIMA: Texte extrait:', content.length, 'caractères'); this.analysisResults = this.performAnalysis(title, content); @@ -297,7 +293,6 @@ class DIMAAnalyzer { createButton() { try { - // Supprimer l'ancien bouton s'il existe const existing = document.getElementById('dima-btn'); if (existing) { existing.remove(); @@ -310,9 +305,10 @@ class DIMAAnalyzer { const button = document.createElement('div'); button.id = 'dima-btn'; + + // Bouton simple SANS logo (comme demandé) button.innerHTML = `🧠 ${this.analysisResults.globalScore}`; - // Style du bouton button.style.cssText = ` position: fixed !important; top: 20px !important; @@ -334,7 +330,6 @@ class DIMAAnalyzer { button.title = `DIMA Score: ${this.analysisResults.globalScore} - ${this.analysisResults.detectedTechniques.length} techniques détectées`; - // Events button.addEventListener('click', () => { this.showModal(); }); @@ -347,7 +342,6 @@ class DIMAAnalyzer { button.style.transform = 'scale(1)'; }); - // Ajouter le bouton au DOM if (document.body) { document.body.appendChild(button); this.buttonCreated = true; @@ -373,7 +367,6 @@ class DIMAAnalyzer { try { console.log('DIMA: Affichage du modal'); - // Supprimer modal existant const existing = document.getElementById('dima-modal'); if (existing) { existing.remove(); @@ -396,11 +389,24 @@ class DIMAAnalyzer { font-family: Arial, sans-serif !important; `; + // Récupérer l'URL du logo via l'API Chrome + const logoUrl = chrome.runtime.getURL('m82-logo-16.png'); + modal.innerHTML = `
-

🧠 Analyse DIMA

-

Détection de manipulation cognitive

+
+ M82 Project +

Analyse DIMA

+
+

+ Détection de manipulation cognitive par + M82 Project +

@@ -435,7 +441,6 @@ class DIMAAnalyzer {
`; - // Event pour fermer en cliquant à l'extérieur modal.addEventListener('click', (e) => { if (e.target === modal) { modal.remove();