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

292
Vistas
WebSocket within iframe sandbox fails on Firefox, but works on Edge/Chrome

The following code shows an <iframe sandbox... pointing to a page that opens a test websocket with a message on successful open. It works correctly on Chrome and Edge printing the It worked! message immediately.

On Firefox it fails with Uncaught DOMException: The operation is insecure. and no further reasoning.

<!DOCTYPE html>
<html lang="en">
  <body>
    <iframe
      sandbox="allow-scripts"
      src="https://firefox-wss-example.tiiny.site/"></iframe>
  </body>
</html>

The linked websocket page source code is simply as follows:

<!DOCTYPE html>
<html lang="en">
  <body>
    <script>
      const ws = new WebSocket('wss://demo.piesocket.com/v3/channel_1?notify_self');

      ws.addEventListener('open', () => {
        console.log('It worked!');
      });
    </script>
  </body>
</html>

I have tried a mixture of wss:// and ws://, as well as permissive CORS headers, but none of my attempts fix the issue on Firefox despite having an appropriate setup. I am starting to think this is a Firefox 97 bug but am unsure of how to verify.

Why does this snippet work on most browsers but fails on Firefox?

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