Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda