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

200
Vistas
Global JavaScript Listener to block specific URL curl from background/child process

I have a JavaScript embedded in HTML using a sdk.js This SDK is using a compiled wasm file (not possible to decompile it), that child is performing a curl to a specific domain.

I am looking for a solution to include a global URL listener in my HTML JavaScript in order to block the curl to that specific domain.

Is this somehow possible? Does anybody has a clever idea to solve that issue?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

according to mdn on FetchEvent and mdn on Abortcontroller.abort() you could do something like

const el = document.querySelector('#exampleId')
const controller = new AbortController()
el.addEventListener('fetch', function(event) {
    if (event.request.url === "someUrl") {
        controller.abort()
    }
})

You will need to attach this event listener to the element that fires the request. if there are going to be multiple elements that do that then you can add the same class to each and use this code to add an event listener to each one:

const elsArray = document.getElementsByClassName('exampleClass')
const controller = new AbortController()
elsArray.forEach(el => {
    el.addEventListener('fetch', function(event) {
        if (event.request.url === "someUrl") {
            controller.abort()
        }
    }
})

never done that myself so let me know how it goes

about 4 years ago · Juan Pablo Isaza Denunciar
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