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

244
Vistas
Firefox is throwing "Uncaught DOMException: The operation is insecure." when using history.replaceState with URL containing basic auth

This problem only happens in Firefox, I've also tried Chrome and it's OK there. I created simple web page for testing purposes to reproduce the problem. The link is here. The contents of the page are:

<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>URL Test with basic auth</title>
  <meta name="description" content="Test for Firefox and handling of history API when basic auth is present">
  <meta name="author" content="Ondrej">

</head>

<body>
  <h1>URL Test</h1>

  <script>

    const addParameter = () => window.history.replaceState(null, '', '/?ok=1')
    window.addEventListener('DOMContentLoaded', () => {
      addParameter()
    })
  </script>
</body>
</html>

Upon loading the web site, I want to add query parameter to the URL by using History API replaceState.

Now, the web server does not contain any actual HTTP basic authentication but if you use it as part of URL, it throws the error. Try copy pasting this into your URL bar:

https://user:pass@offbeat-cattle.surge.sh

The problem only happens in Firefox browser (tested on 94.0.1) where it fails to add query parameter to URL and throws this error in the console:

Uncaught DOMException: The operation is insecure.
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