fix: team-block-script.js redirige directement vers team.html

- Supprime la logique de blocage complexe
- Redirige simplement /team vers /team.html
- Ne bloque plus si on est déjà sur team.html
This commit is contained in:
syoul
2025-12-09 15:26:44 +01:00
parent be86854c7e
commit 45fc4c56d9

View File

@@ -1,36 +1,19 @@
// SCRIPT ANTI-ÉQUIPE - CHARGÉ EN PREMIER
// SCRIPT ÉQUIPE - REDIRECTION VERS team.html
(function() {
'use strict';
// DÉTECTION PAGE ÉQUIPE
var isTeamPage = window.location.pathname === '/team' ||
window.location.pathname === '/team/' ||
window.location.pathname.startsWith('/team/') ||
window.location.href.includes('/team');
// DÉTECTION PAGE ÉQUIPE (mais PAS team.html)
var path = window.location.pathname;
var isTeamRoute = path === '/team' || path === '/team/' || path.startsWith('/team/');
var isTeamHtml = path === '/team.html';
if (isTeamPage) {
console.log('🚫 BLOQUEUR ÉQUIPE ACTIF - Page équipe détectée');
// Bloquer les scripts qui interfèrent avec la page équipe
window.__blockTeamPages = true;
// Permettre quand même les scripts essentiels pour la navigation
var originalAppendChild = Element.prototype.appendChild;
Element.prototype.appendChild = function(child) {
if (child.tagName === 'SCRIPT' && child.src) {
// Bloquer seulement strategie-script.js qui cause les problèmes
if (child.src.includes('strategie-script.js')) {
console.log('🚫 Script strategie-script.js BLOQUÉ sur page équipe');
return child; // Ne pas l'ajouter
}
// Permettre les autres scripts (navigation, etc.)
}
return originalAppendChild.call(this, child);
};
console.log('✅ Navigation et scripts essentiels autorisés sur page équipe');
if (isTeamRoute && !isTeamHtml) {
console.log('🔄 ÉQUIPE: Redirection vers /team.html');
window.location.replace('/team.html');
return;
}
console.log('✅ Page normale détectée - tous scripts autorisés');
if (isTeamHtml) {
console.log('✅ ÉQUIPE: Page team.html chargée directement');
}
})();