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

194
Views
XMLHttpRequest funciona en Chrome pero no en Firefox

Actualmente estoy trabajando en una extensión para integrar dos sistemas en mi trabajo. La extensión de Chrome funciona bien y funciona bien, pero mi equipo también solicitó una versión de Firefox, en Firefox tengo problemas con xmlhttprequest(),

la función que llama a la solicitud es esta:

 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 ); }) }

(Sé que no es seguro enviar API_KEY en el POST, pero solo se ejecuta en nuestra red local, por lo que probablemente esté bien por ahora)

Cuando lo ejecuto, va directamente a onerror, es más rápido que el tiempo de espera y no se muestra en la pestaña de red en la inspección, creo que necesito darle algunos permisos o algo en Firefox para que pueda ejecutarse.

además, el manifiesto de la extensión es este (¿tal vez el problema está aquí?):

 { "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, después de investigar un poco, encontró un mensaje de error: Error: Obtuve una solicitud http://10.255.12.128/api/get_models/ sin un conjunto de ID de contexto de navegación

La función que llama al error tiene este comentario:

 // 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` ); }

¿Cómo y dónde configuro este ID de contexto?

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!