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

174
Views
Chrome extension: How to save any data from a page?

maybe someone can explain me how to resolve this problem:

For example I have this code:

let btn = document.getElementById('defbtn');

if (btn != null) {
    btn.onclick =  function(el) {
        chrome.tabs.query({active:true, currentWindow: true}, function(tabs) {
            chrome.tabs.executeScript(
                tabs[0].id,
                {code: "var textP = document.evaluate( 'any_xpath_here', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue.innerHTML;"}
            );
        });
        
        // How to get value from textP? To execute for example     alert(textP);
    }
}

How can I access textP value from chrome extension or how can I save textP in a chrome extension variable?

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!