Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda