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

206
Vistas
XMLHttpRequest.open() and .send() does not work

When I call this small piece of code in the Firefox browser console it works just fine. Sending a get request as it is supposed to.

{
  var http = new XMLHttpRequest();
  http.open("GET", "http://localhost:3456/?" + "q=test", true);
  http.send(null);
}

But as soon as I put the code into my Firefox content script - "permissions": ["*://localhost:3456/*","webRequest"] are set in the manifest.json, it refuses to send that request.

sendLocalPostRequest("q=test");

function sendLocalPostRequest(params) {
  var http = new XMLHttpRequest();
  const aURL = "http://localhost:3456/?" + params;
  http.open("GET", aURL, true);
  http.send(null);
}

I have the feeling that something is blocking the web request, but I can't figure out what it is. I already checked if one of the code lines throws an error message, but there aren't any... Any ideas on what could be the problem here?


UPDATE: I just added a few new permissions and one or the other seems to have solved my problem. Here they are "tabs","*://*/*",

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