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

157
Views
Why is requestBody returning undefined in chrome extension?

When I run my code, it first logs the URL of the network request then when I try logging the body, it just says undefined. When I click on the URL link that is logged in the console from the first console.log, it downloads the js file onto my PC that I am trying to print. Is there something wrong with my requestBody or is there another way of printing the content of the js file into the console without having to open it?

//background.js
function logURL(requestDetails) {

    if (requestDetails.url.includes("getMe"))
    {
      console.log(requestDetails.url)
       console.log(requestDetails.requestBody) 
    }

  }
  chrome.webRequest.onBeforeRequest.addListener(
    logURL,
    {urls: ["<all_urls>"]},
    ['requestBody']
  );
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!