Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

298
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda