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

193
Views
Call an async function from within a blocking chrome.webRequest.onBeforeRequest handler?

I have a Chrome Extension which has an chrome.webRequest.onBeforeRequest handler, with ["requestBody", "blocking"] params.

I want to call an async function inside the background script from within this handler.

Currently I use chrome.tabs.sendMessage to pass a message to the content script which then receives it and sends a message to the background using chrome.extension.sendMessage, which receives it and calls the said async function.

Both the background & content script are using chrome.runtime.onMessage to listen to those messages.

This feels like a pretty messy workaround - I guess I don't need the content script to act as proxy.
Can I trigger an async function from within the onBeforeRequest handler directly?

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!