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

109
Views
Why are requests not getting blocked in my react-native web-view through the onShouldStartLoadWithRequest function?

I am trying to block content in a react-native web view using the onShouldStartLoadWithRequest function. I use async functions for the engine that decides whether or not to block a specific request. Since I am using an async function to load the engine and need to return a boolean to the onShouldStartLoadWithRequest function, I ended up using the .then method to pass the engine variable to my function that uses it. However, when I test this out, no requests are getting blocked. I tried logging the code ran in the .then method in the console to see what is going on and I did end up getting a boolean. However, when I tried another random async function that always returns false(it will always block content), that didn't work either(with a normal function it did work), so I feel like I am not handling the async functions correctly somehow. Here is my applicable code. In the end I am trying to return a boolean, is that not what is happening in the onShouldStartLoadWithRequest function?

//This is my loading function - it is located outside of the onShouldStartLoadWithRequest function
 async function loadEngine() {
    let engine = await FiltersEngine.fromPrebuiltAdsAndTracking(fetch);
    return engine
  }
//This is my onShouldStartLoadWithRequest function
 onShouldStartLoadWithRequest={(WebViewRequest) => {
          function useEngine(requestURLS, engine) {
            const {
              match
            } = engine.match(Request.fromRawDetails({
              url: requestURLS,
            }))
            let final_output;
            final_output = !match
            return final_output
          }
          return loadEngine().then((engine) => (useEngine(WebViewRequest.url, engine)))
        }}
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!