Firefox Compatibility Updates

Issues Addressed

1. Auto-Save Disabled in Firefox

Problem: Firefox doesn’t properly support persistent file handles across page refreshes, even though it has the File System Access API.

Solution:

2. CSS Rendering Issues in Firefox

Problem: Firefox had issues with:

Solution: Added Firefox-specific CSS fixes to src/index.css:

@-moz-document url-prefix() {
  /* Ensure light mode works properly */
  :root {
    color-scheme: light;
  }

  [data-theme="dark"] {
    color-scheme: dark;
  }

  /* Fix border and background rendering */
  * {
    background-clip: padding-box;
  }

  /* Ensure CSS variables work */
  body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
  }

  /* Fix form element backgrounds */
  input, textarea, select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
  }

  /* Fix button backgrounds */
  button {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
  }
}

Browser Support Matrix

Feature Chrome/Edge Safari 15.2+ Firefox
Auto-save to file ✅ Yes ✅ Yes ❌ No (fallback to download)
File handle persistence ✅ Yes ✅ Yes ❌ No
Manual save/open ✅ Yes ✅ Yes ✅ Yes (downloads)
Light/Dark mode ✅ Yes ✅ Yes ✅ Yes (fixed)
All other features ✅ Yes ✅ Yes ✅ Yes

User Experience in Firefox

What Works

What’s Different

User Workflow in Firefox

  1. Create/Edit: Work normally in the editor
  2. Save: Press Ctrl+S or File > Save
  3. File Downloaded: File goes to Downloads folder
  4. Continue Working: Keep editing
  5. Save Again: File downloads again (may need to replace)
  6. Re-open: Use File > Open to select the file from Downloads

Future Improvements

Potential enhancements for Firefox users:

  1. Show browser notification when auto-save is disabled
  2. Periodic save reminders for Firefox users
  3. Auto-download on close if there are unsaved changes
  4. Local storage backup as additional safety net

Technical Notes

Why Not Just Fix Firefox Support?

Firefox’s File System Access API implementation has a critical limitation:

Rather than provide a broken experience, we opted for a reliable fallback that works consistently.

Detection Method

We detect Firefox using:

const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;

This is reliable and works across all Firefox versions.