Skip to content

fix(clock): handle NS_ERROR_NOT_INITIALIZED in Firefox embedder timers#40012

Open
7rulnik wants to merge 1 commit intomicrosoft:mainfrom
7rulnik:fix-40011
Open

fix(clock): handle NS_ERROR_NOT_INITIALIZED in Firefox embedder timers#40012
7rulnik wants to merge 1 commit intomicrosoft:mainfrom
7rulnik:fix-40011

Conversation

@7rulnik
Copy link
Copy Markdown

@7rulnik 7rulnik commented Apr 1, 2026

Summary

  • Firefox throws NS_ERROR_NOT_INITIALIZED when calling native setTimeout/setInterval on a window whose JS context is no longer available
  • The clock embedder in createClock() uses saved native timer references for the real-time sync loop, which can throw when the window context
    becomes unavailable
  • Wraps the embedder setTimeout/setInterval calls in try/catch so the clock skips one sync tick and recovers

Fixes #40011

Firefox throws NS_ERROR_NOT_INITIALIZED when calling native
setTimeout/setInterval on a window whose context is no longer
available. This wraps the embedder timer calls in try/catch so
the clock recovers gracefully instead of crashing.

Fixes microsoft#40011
@7rulnik
Copy link
Copy Markdown
Author

7rulnik commented Apr 1, 2026

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: clock.resume() causes NS_ERROR_NOT_INITIALIZED in Firefox on Linux

1 participant