Description
When Playwright launches Firefox, it sets focusmanager.testmode = true in the user's Firefox profile. This pref is not cleaned up after Playwright exits, leaving it permanently in the user's normal Firefox profile.
This breaks fcitx5 (and likely other input method frameworks like IBus) in the user's daily browser, because focusmanager.testmode changes how focus events are dispatched, preventing the input method from properly receiving focus signals.
Steps to reproduce
- Use Playwright to launch Firefox (persistent or non-persistent context)
- Close Playwright
- Open Firefox normally
- Try using fcitx5/IBus input method (Ctrl+Space) → does not respond
- Check
about:config → focusmanager.testmode is true
- Check
prefs.js → contains user_pref("focusmanager.testmode", true);
Expected behavior
Playwright should:
- Either only set testmode prefs in temporary/isolated profiles (not the user's default profile)
- Or clean up testmode prefs when the browser context is closed
Actual behavior
focusmanager.testmode = true persists in the user's Firefox profile permanently, silently breaking input method functionality.
Environment
- Playwright Python 1.60.0
- Firefox 150.0.2 (Playwright-bundled)
- Gentoo Linux, XFCE4 (X11)
- fcitx5 5.1.19
Impact
Any Linux user who uses Playwright with Firefox and also uses fcitx5/IBus for CJK input will have their input method broken without any obvious cause. The user cannot reasonably connect "Playwright stopped working" to "my Chinese keyboard input is broken."
Workaround
Delete the pref from the user's Firefox profile:
sed -i '/focusmanager.testmode/d' ~/.mozilla/firefox/*.default*/prefs.js
Fix suggestion
Use a temporary/isolated profile for testmode prefs, or unset focusmanager.testmode on browser context close.
Description
When Playwright launches Firefox, it sets
focusmanager.testmode = truein the user's Firefox profile. This pref is not cleaned up after Playwright exits, leaving it permanently in the user's normal Firefox profile.This breaks fcitx5 (and likely other input method frameworks like IBus) in the user's daily browser, because
focusmanager.testmodechanges how focus events are dispatched, preventing the input method from properly receiving focus signals.Steps to reproduce
about:config→focusmanager.testmodeistrueprefs.js→ containsuser_pref("focusmanager.testmode", true);Expected behavior
Playwright should:
Actual behavior
focusmanager.testmode = truepersists in the user's Firefox profile permanently, silently breaking input method functionality.Environment
Impact
Any Linux user who uses Playwright with Firefox and also uses fcitx5/IBus for CJK input will have their input method broken without any obvious cause. The user cannot reasonably connect "Playwright stopped working" to "my Chinese keyboard input is broken."
Workaround
Delete the pref from the user's Firefox profile:
Fix suggestion
Use a temporary/isolated profile for testmode prefs, or unset
focusmanager.testmodeon browser context close.