From 37612a7b8124c9dbfb91e0fa44e4c65179de3599 Mon Sep 17 00:00:00 2001 From: Hermes Date: Mon, 18 May 2026 20:04:24 +0000 Subject: [PATCH] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20autom=C3=A1tica:=202026?= =?UTF-8?q?-05-18=2020:04:24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-interface/server.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web-interface/server.js b/web-interface/server.js index b26cf6f..355fafc 100644 --- a/web-interface/server.js +++ b/web-interface/server.js @@ -142,11 +142,17 @@ app.use((req, res, next) => { try { let jsContent = fs.readFileSync(filePath, 'utf8'); - // Substitui chamadas diretas a window.location.pathname ou location.pathname em uma Ășnica passagem limpa - jsContent = jsContent.replace(/(?:window\.)?location\.pathname/g, '(window.__mockLocationPathname || window.location.pathname)'); + // Substitui window.location.pathname de forma segura + jsContent = jsContent.replace(/\bwindow\.location\.pathname\b/g, '(window.__mockLocationPathname || window.location.pathname)'); - // Substitui chamadas diretas a window.location.href ou location.href em uma Ășnica passagem limpa - jsContent = jsContent.replace(/(?:window\.)?location\.href/g, '(window.__mockLocationHref || window.location.href)'); + // Substitui location.pathname isolado (evita quebrar e.location.pathname ou history.location.pathname) + jsContent = jsContent.replace(/(?