Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!