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

290
Views
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
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!