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:
@@ -1,36 +1,19 @@
|
|||||||
// SCRIPT ANTI-ÉQUIPE - CHARGÉ EN PREMIER
|
// SCRIPT ÉQUIPE - REDIRECTION VERS team.html
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// DÉTECTION PAGE ÉQUIPE
|
// DÉTECTION PAGE ÉQUIPE (mais PAS team.html)
|
||||||
var isTeamPage = window.location.pathname === '/team' ||
|
var path = window.location.pathname;
|
||||||
window.location.pathname === '/team/' ||
|
var isTeamRoute = path === '/team' || path === '/team/' || path.startsWith('/team/');
|
||||||
window.location.pathname.startsWith('/team/') ||
|
var isTeamHtml = path === '/team.html';
|
||||||
window.location.href.includes('/team');
|
|
||||||
|
|
||||||
if (isTeamPage) {
|
if (isTeamRoute && !isTeamHtml) {
|
||||||
console.log('🚫 BLOQUEUR ÉQUIPE ACTIF - Page équipe détectée');
|
console.log('🔄 ÉQUIPE: Redirection vers /team.html');
|
||||||
|
window.location.replace('/team.html');
|
||||||
// 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');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('✅ Page normale détectée - tous scripts autorisés');
|
if (isTeamHtml) {
|
||||||
|
console.log('✅ ÉQUIPE: Page team.html chargée directement');
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user