Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
Google Chrome Extension - DOM Manipulation Not Working After Page Refresh

I have this very simple Google Chrome extension that manipulates any anchor tag element with has value callto. The problem is it is working only at the initial load of extension but once I refreshed the page it is not working anymore. Please watch this video regarding the behavior of the issue.

In my Content.Js below is my code.

function SoftPhone() { 
    const links = document.querySelectorAll('[href^=callto]');

    links.forEach(link => {

        link.getAttribute("href");
        link.setAttribute("href",
            "https://app.callrail.com/lead-center");
        link.textContent = "Call with SoftPhone";
    });
}

window.addEventListener('load', SoftPhone);

Here's my manifest file, very basic.

{
"manifest_version" : 2,
"name": "SoftPhone",
"version": "1.0.0",
"content_scripts" : [
    {
    "matches": ["<all_urls>"],
    "js": ["Content.js"]
    }
    
    ]
}

I'm using it on Podio.com for their standard phone field element below.

<a href="callto:3213211234" data-reactid=".b.0.2.$0.$callto.0">
  <span class="phone-field-component__icon phone-field-component__icon-phone" data-reactid=".b.0.2.$0.$callto.0.0"></span>
  <span data-reactid=".b.0.2.$0.$callto.0.1">Call</span>
</a>

To test it, you may login using free account I setup below in Podio.com

Username: marlontc18@gmail.com Password: Marlz2022!

Then access this item - https://podio.com/marlz/project-management/apps/contacts-2/items/1

and look for Phone Number field

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda