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

193
Vistas
XMLHttpRequest working on chrome but not in firefox

I'm currently working on an extension to integrate two systems at my work, The chrome extension is running just fine and working well, but my team also asked for a firefox version, in firefox I'm having trouble with the xmlhttprequest(),

the function that calls the request is this one:

function getModelList(API_KEY)
{
  return new Promise(resolve => {
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "POST", 'http://10.255.12.128/api/get_models/', true );
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmlHttp.onload = function(e) {
      resolve(xmlHttp.response);
    };
    xmlHttp.onerror = function (e) {
      resolve(undefined);
      console.error("** An error occurred during the XMLHttpRequest");

    };
    xmlHttp.send( 'API_KEY='+API_KEY );
  })
}

(I know it not secure to send the API_KEY in the POST, but it only runs in our localnetwork so its probably fine for now)

When I run it, it goes direcly to onerror, It is faster then the timeout, and don't show in the network tab on inspection, I think I need to give it some permissions or something in firefox so it can run?

also, the manifest for the extension is this one(maybe the problem is here?):

{
    "name" : "Zabbix-Bitrix Integration",
    "version": "0.0.4",
    "manifest_version": 2,
    "description" : "Insere funções extras ao zabbix",
    
    "options_ui": {
        "page": "options.html",
        "open_in_tab": false,
        "browser_style": true,
        "chrome_style": true
    },

    "content_scripts" : [
        {
            "js" : ["init.js"],
            "css": ["styles.css"],
            "matches" : ["*://zabbix.monitor.redeunifique.com.br/zabbix.php?action=problem.view*"]
        }
    ],
    "permissions": ["storage","webRequest"]
}

@edit, after some digging, found an error message: Error: Got a request http://10.255.12.128/api/get_models/ without a browsingContextID set

The function that calls the error has this comment:

// Ensure that we have a browsing context ID for all requests when debugging a tab (=`browserId` is defined).
// Only privileged requests debugged via the Browser Toolbox (=`browserId` null) can be unrelated to any browsing context.
if (!this._browsingContextID && this._networkEventWatcher.browserId) {
  throw new Error(
    `Got a request ${this._request.url} without a browsingContextID set`
  );
}

How and where do I set this Context ID ?

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