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

207
Views
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
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!