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

180
Visualizações
Execute Chrome Developer Console Commands though Chrome Extension

End Goal: I want to create a Chrome Extension using which I can execute basic Web Analytics commands for different tools by configuring few buttons in extensions.

Issue: I am able to create a basic extension and get alert generated on click of a button as a test. Now I am aiming to execute commands involving Tealium or Adobe Launch or Evidon and output the results through an alert. But I am seeing absence of .js file as error.

Example Scenario: If my website contains Tealium Tag Manager, then I can execute utag.cfg.v on chrome console command and get latest Tealium version as a string like "2022.07.04.5625". I want to store output of this command into a variable and execute it on click of chrome extension button. When I run code in console, it works fine but running it through extension does nothing! I can see error as "utag is not defined". Sample code below.

popup.js

document.addEventListener('DOMContentLoaded', function() {
  var checkButton = document.getElementById('check');
  checkButton.addEventListener('click', function() 
  {
        var test = utag.cfg.v;
        //var test = "Hello!"
        alert("Test Output:" + test);
          
        }, false);
}, false);

popup.html

<html>
      <head>
        <title>Test of Times!</title>
        <script src="popup.js"></script>
      </head>
      <body>
        <h1>Web Analytics</h1>
         <h3 class="sub-heading">Chrome extension for Web Analytics.</h3>
        <button id="check">Test Me</button>
      </body>
    </html>

Any help will is much appreciated and I am not very well versed in JavaScript so please feel free to point out details even if it's very obvious.

Thanks!

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