From a5ace8b0fae6e12059e6cac99f7bd2c35da6469f Mon Sep 17 00:00:00 2001 From: syoul Date: Tue, 9 Dec 2025 12:47:17 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20approche=20ultra-agressive=20contre=20le?= =?UTF-8?q?s=20pages=20=C3=A9quipe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Nouveau script team-block-script.js chargé en premier (config-business.json) - Bloqueur absolu qui empêche tout autre script sur /team - Page team.tsx encore plus agressive (remplacement useEffect) - Double protection dans strategie-script.js - Script principal bloqué si __blockTeamPages=true Cette approche à couches multiples devrait définitivement résoudre : - Les deux liens équipe (1 seul) - L'affichage radar au lieu des visualisations --- Dockerfile.business | 33 +++++++++++++++++++++++------ public/strategie-script.js | 33 +++++++++++++++++------------ public/team-block-script.js | 30 ++++++++++++++++++++++++++ radar-business/config-business.json | 2 +- 4 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 public/team-block-script.js diff --git a/Dockerfile.business b/Dockerfile.business index e922614..e3d2bbd 100644 --- a/Dockerfile.business +++ b/Dockerfile.business @@ -98,14 +98,33 @@ RUN echo "📊 Comptage des fichiers .md dans .techradar/data/radar" && \ # La page Next.js pour le routing, le HTML statique pour garantir l'affichage RUN mkdir -p .techradar/src/pages && \ cat > .techradar/src/pages/team.tsx << 'EOF' -export default function TeamPage() { - // Version ultra-simple pour éviter les erreurs de compilation - if (typeof window !== 'undefined') { - // Remplacer immédiatement le contenu par l'iframe - document.body.innerHTML = ''; - } +import { useEffect } from 'react'; - return null; // Ne rien rendre côté serveur +export default function TeamPage() { + useEffect(() => { + // Remplacement AGRESSIF du contenu + console.log('🔄 TEAM PAGE: Remplacement du contenu par iframe'); + + // Supprimer tout contenu existant + document.body.innerHTML = ''; + + // Créer l'iframe + const iframe = document.createElement('iframe'); + iframe.src = '/team.html'; + iframe.style.cssText = 'width:100vw;height:100vh;border:none;margin:0;padding:0;position:fixed;top:0;left:0;z-index:9999;background:#1a4d3a;'; + iframe.title = 'Équipe & Technologies'; + + // Ajouter l'iframe + document.body.appendChild(iframe); + + // Bloquer tout autre chargement + window.__teamPageLoaded = true; + + console.log('✅ TEAM PAGE: Iframe chargé'); + }, []); + + // Ne rien rendre côté serveur + return null; } EOF RUN echo "✅ Page team.tsx créée (version ultra-simplifiée)" && \ diff --git a/public/strategie-script.js b/public/strategie-script.js index bbe35fd..175cfbe 100644 --- a/public/strategie-script.js +++ b/public/strategie-script.js @@ -1,19 +1,21 @@ -// Script pour la gestion des pages de stratégie +// SCRIPT ULTRA-PROTECTEUR CONTRE LES PAGES ÉQUIPE (function() { - // PROTECTION ABSOLUE : Arrêter immédiatement si on détecte une page équipe - // Cette vérification doit être la PREMIÈRE chose exécutée - var isTeamPage = window.location.pathname === '/team' || - window.location.pathname === '/team/' || - window.location.pathname.startsWith('/team/') || - window.location.href.includes('/team'); - - if (isTeamPage) { - console.log('🚫 Script stratégie BLOQUÉ sur page équipe - arrêt immédiat'); - return; + // VÉRIFICATION ABSOLUE - S'EXÉCUTE AVANT TOUT + if (window.location.pathname === '/team' || + window.location.pathname.startsWith('/team/') || + window.location.href.includes('/team')) { + console.log('🚫 INTERDICTION TOTALE - Page équipe détectée, arrêt du script'); + // Bloquer complètement l'exécution + window.__blockAllScripts = true; + return false; } - // Marquer qu'on n'est pas sur une page équipe - window.__notTeamPage = true; + // Marquer qu'on autorise les autres scripts + window.__allowScripts = true; +})(); + +// Script pour la gestion des pages de stratégie UNIQUEMENT SI AUTORISÉ +if (!window.__blockAllScripts && !window.__blockTeamPages) { // PROTECTION : Ne pas interférer avec les pages Next.js function shouldSkipExecution() { @@ -1069,4 +1071,7 @@ Interface de pilotage pour les responsables sécurité des PME. } }, 5000); } -})(); +} + +// Fermeture du bloc conditionnel - script s'exécute uniquement si pas sur page équipe +} diff --git a/public/team-block-script.js b/public/team-block-script.js new file mode 100644 index 0000000..3630e8c --- /dev/null +++ b/public/team-block-script.js @@ -0,0 +1,30 @@ +// SCRIPT ANTI-ÉQUIPE - CHARGÉ EN PREMIER +(function() { + 'use strict'; + + // BLOQUER ABSOLUMENT TOUTES LES PAGES ÉQUIPE + if (window.location.pathname === '/team' || + window.location.pathname === '/team/' || + window.location.pathname.startsWith('/team/') || + window.location.href.includes('/team')) { + + console.log('🚫 BLOQUEUR ÉQUIPE ACTIF - Page équipe détectée'); + + // Empêcher tout autre script de s'exécuter + window.__blockTeamPages = true; + + // Bloquer immédiatement tout chargement de script + var originalAppendChild = Element.prototype.appendChild; + Element.prototype.appendChild = function(child) { + if (child.tagName === 'SCRIPT' && child.src && child.src.includes('strategie-script.js')) { + console.log('🚫 Script strategie-script.js BLOQUÉ sur page équipe'); + return child; // Ne pas l'ajouter + } + return originalAppendChild.call(this, child); + }; + + return; // Arrêt immédiat + } + + console.log('✅ Page normale détectée - scripts autorisés'); +})(); diff --git a/radar-business/config-business.json b/radar-business/config-business.json index bf7fb92..f4c486b 100644 --- a/radar-business/config-business.json +++ b/radar-business/config-business.json @@ -3,7 +3,7 @@ "baseUrl": "", "editUrl": "https://git.open.us.org/syoul/TechradarDev/_edit/main/radar-business/{release}/{id}.md", "logoFile": "logo.svg", - "jsFile": "/strategie-script.js", + "jsFile": "/team-block-script.js", "toggles": { "showChart": true, "showTagFilter": true,