Firefox on Darwin: Web Crypto API fails to execute

Hello everyone,

Thanks to the community’s support, Firefox on Darwin has recently been added — which is great!

I’m currently trying to manage my Firefox configuration using home-manager, but I’ve encountered some strange behavior that can be easily reproduced by running the following JavaScript in the console:

self.crypto.getRandomValues(new Uint16Array(8));

This results in the following error:

Uncaught DOMException: The operation failed for an operation-specific reason
    <anonymous> debugger eval code:1

This error is related to the widely supported Web Crypto API and causes many websites to crash or fail to load properly, including:

What I’ve tried so far:

  • Removed all Firefox profiles → :x: Issue persists
  • Upgraded flake and tested with Firefox 163.0.1 and 163.0.2:x: Issue persists
  • Tried firefox-esr:x: Issue persists
  • Installed Firefox via Homebrew → :white_check_mark: Issue resolved
  • Use firefox-bin provided by nixpkgs-firefox-darwin:white_check_mark: Issue resolved

I also searched GitHub and the web but couldn’t find a related bug report. Given how easily this can be reproduced and how critical the issue is, I’m wondering if I’m missing something obvious.

Any ideas or suggestions? Any help would be greatly appreciated!

I’m still hoping to get your help.