const regex = /R\$\s*/g; function replaceInTextNode(node) { if (node.nodeType === 3) { // texto const oldVal = node.textContent; if (regex.test(oldVal)) { node.textContent = oldVal.replace(regex, "pts "); } } } function mudaMoeda() { setTimeout(function() { const el = document.querySelector(".s-produtos-detalhes-cabecalho-preco-valor"); if (el) { el.textContent = el.textContent.replace(/R\$\s*/, "pts "); } }, 1000); const observer = new MutationObserver(mutations => { for (const mutation of mutations) { // Texto alterado if (mutation.type === "characterData") { replaceInTextNode(mutation.target); } // Novos elementos adicionados if (mutation.type === "childList") { mutation.addedNodes.forEach(node => { // Se for texto if (node.nodeType === 3) { replaceInTextNode(node); } // Se for elemento, processa apenas filhos diretos (leve) if (node.nodeType === 1) { node.querySelectorAll("*").forEach(el => { el.childNodes.forEach(n => replaceInTextNode(n)); }); } }); } } }); observer.observe(document.body, { childList: true, subtree: true, characterData: true }); // Primeira rodada (bem leve) document.body.querySelectorAll("*").forEach(el => { el.childNodes.forEach(n => replaceInTextNode(n)); }); } const dadosFooterLogin = `
` const dadosPrazoFrete = `O pedido será entregue junto com a campanha vigente.