5

I'm running Firefox on Ubuntu 24.04 with the KDE desktop environment under X11 (not Wayland). Firefox works normally for several days without issues. However, suddenly, it stops responding to keyboard input in a peculiar way: keystrokes are registered, but they are delayed by 17 seconds before appearing. This delay only affects Firefox - other applications like Konsole, gedit, Brave, and VLC respond to keyboard input normally without any lag.

These are affected:

  • Address field
  • Copies in Print dialog
  • Text field in Gmail

These are not affected:

  • Page-Up/Down in scrolling
  • CTRL-Page-Up/Down (change tab)
  • CTRL-P (open print dialog)
  • Esc (Cancel print dialog)

The system is otherwise stable, and restarting Firefox resolves the issue temporarily. The problem may reappear hours or days later, seemingly at random. I haven’t noticed any specific triggers yet.

ibus restart does not fix it.

Has anyone experienced this issue or have insights into what might cause Firefox to exhibit this delayed keyboard input behavior under these conditions? Are there logs or debugging steps I could use to narrow down the cause?

OS: Ubuntu 24.04
DE: KDE (using X11, not Wayland)
Firefox: Mozilla Firefox 135.0.1

3
  • Does that affect all tabs and input in all areas including for instance the Open file... dialog? Anything in the console (Ctrl+Shift+K)? Any high CPU usage of one particular thread of firefox or the X11 server? Commented Feb 21 at 18:50
  • @StéphaneChazelas All tabs and windows. Also address line. No CPU abnormal use. I will have get back to you on the dialogs and console. The last time it happened when the computer was quite loaded. Maybe it is a race condition that is easier triggered if the load is high? Commented Feb 23 at 11:08
  • 2
    I have the same issue. Ubuntu 24.04.1 LTS x11 Firefox 135.0.1 (64-bit) snap. - No problem with other apps, but huge delay in Firefox. Firefox-restart solves temporarily. Was using system for some months, never had the problem, now twice in one day. Only out-of-the-ordinary actions in the last days were SSH from console into my Zyxel LAN-NAS (while also being in the Zyxel browser GUI), and re-mapping the printscreen commands to another key via the built in Ubuntu-GUI Commented Mar 11 at 20:09

1 Answer 1

5

I have this exact same issue, for a long time already, today I miraculously figured out a fix/workaround.

TL;DR:
Start a new window by dragging a tab away from your misbehaving window. Roughly 25 seconds later, this new window will start functioning again. Drag all your misbehaving tabs over to this new window, and they will immediately start working again too.

Problem description

Firefox version
137.0.2 (64-bit) Snap for Ubuntu
Running on Ubuntu 22.04.5 LTS

It appears sporadically, usually near the end of the day (I'd guess after about 3 to 6 hours of working in Firefox). It's hard to say how often it happens (it's hard to notice when it doesn't happen) but I'd say it's about 50% of my working days.

It almost always occurs while I'm typing. I've never encountered my browser in this state after reading/scrolling for a while, as far as I can tell it always appears mid-sentence or mid-word. It doesn't progressively get slower, it goes from working normally to a delay of 15 seconds per key-press.

When the issue appears, it always appears immediately, and on all windows that I have open.

All other functions of the browser remain working just like normal. So typing something in a text editor, and copying it over to the browser (using the mouse menu for pasting, not ctrl + v, so you don't have to wait 15 seconds for it to happen) is a fine temporary workaround.

A better solution for your sanity is shutting down the browser and restarting it. This always solves it for me, and usually it doesn't reoccur in the same session. I have Firefox configured to remember my open tabs and windows between sessions, and Firefox takes a few minutes to fully load after stopping, so this is not an ideal solution. (I've already tried to start from a fresh profile a few months ago, this didn't help)

Finding a solution

I tried to see if it appears in all input-fields, like suggested in the comments here. While messing around there, the problem actually disappeared. I've never managed to make it go away before, so I just spent a few hours trying to isolate the actions that make the problem go away.

When the issue is fixed. It's fixed for that window and all it's tabs.

When you go to a window that still has the issue, you can create a new tab there, and drag it, to make a new window, this window will then inherit the issue. Creating a new window via the menu has the same effect.

I spent a lot of time trying to pinpoint what actions caused it to be fixed in the new window, finally I figured out that it's just always fixed after about 25 seconds, no matter what you do. Give the window focus, don't give it focus, press keys randomly, keep a key pressed down or wait 30 seconds before you press a key, click in the address-bar, don't click in the address bar. It doesn't matter. When you create a new window, 25 seconds later, that window no longer has the issue.

So that doesn't help to fix the windows that already have the issue... But, what you can do is create a new window, drag the tabs of the broken window there, and wait 25 seconds. Dragging a tab to a working window fixes it instantly. Dragging a tab to a newly created window, in the first 25 seconds doesn't fix it yet, but it will then be fixed when the 25 seconds have passed.

Final thoughts

I hope this helps some people fix their sessions without having to restart their browser. And maybe this will even help someone find the cause for this issue, so it can be fixed!

I'm not sure this is related, but I saw a lot of errors like this, around the time the problem started, in the "Browser console":

17:37:27.561 Error: Connection closed, pending request to server0.conn0.watcher2.process4//styleSheetsActor476, type getText failed

Request stack:
request@resource://devtools/shared/protocol/Front.js:299:14
generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:47:19
_fetchSourceText@resource://devtools/client/styleeditor/StyleSheetEditor.sys.mjs:287:40
    baseFrontClassDestroy resource://devtools/shared/protocol/Front.js:105
    destroy resource://devtools/shared/protocol/Front.js:73
    destroy resource://devtools/shared/protocol/Pool.js:213
    baseFrontClassDestroy resource://devtools/shared/protocol/Front.js:109
    purgeRequests resource://devtools/client/devtools-client.js:679
    onPacket resource://devtools/client/devtools-client.js:470
    send resource://devtools/shared/transport/local-transport.js:73
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
StyleSheetEditor.sys.mjs:342:17
Request stack:
request@resource://devtools/shared/protocol/Front.js:299:14
generateRequestMethods/</frontProto[name]@resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:47:19
_fetchSourceText@resource://devtools/client/styleeditor/StyleSheetEditor.sys.mjs:287:40
    baseFrontClassDestroy resource://devtools/shared/protocol/Front.js:105
    destroy resource://devtools/shared/protocol/Front.js:73
    destroy resource://devtools/shared/protocol/Pool.js:213
    baseFrontClassDestroy resource://devtools/shared/protocol/Front.js:109
    purgeRequests resource://devtools/client/devtools-client.js:679
    onPacket resource://devtools/client/devtools-client.js:470
    send resource://devtools/shared/transport/local-transport.js:73
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
StyleEditorUI.sys.mjs:1574:15
Error: Target already destroyed, unable to fetch children fronts
    getFront resource://devtools/client/fronts/targets/target-mixin.js:235
    _getStyleSheetsFront resource://devtools/client/styleeditor/StyleSheetEditor.sys.mjs:946
    _fetchSourceText resource://devtools/client/styleeditor/StyleSheetEditor.sys.mjs:279
    fetchSource resource://devtools/client/styleeditor/StyleSheetEditor.sys.mjs:333
    #addStyleSheetEditor resource://devtools/client/styleeditor/StyleEditorUI.sys.mjs:712
    promise resource://devtools/client/styleeditor/StyleEditorUI.sys.mjs:576
StyleSheetEditor.sys.mjs:342:17

Edit to add:

I have a hunch this bug may be caused by one (or a combination) of the extensions I'm using. But since the bug only appears occasionally and cannot be reproduced at will, this is very hard to test... If we all have the same uncommon combination of extensions, that could be a clue?

I'm using:

  • Privacy badger 2025.3.27
  • uBlock Origin 1.63.2
  • Bitwarden - Free Password Manager (disabled) 2024.4.1
  • floccus bookmarks sync (disabled) 5.5.3
  • PassFF (disabled) 1.22.1

I've just disabled some of these, as a test, they were all active when the issue appeared before.

Edit2: The issue just reappeared, so it seems that it wasn't Bitwarden, Floccus or PassFF... I've now Disabled Privacy Badger and uBlock, lets see if that prevents it from reappearing.

Also, it seems like the "fix" of moving into a new window, doesn't fix it very long term. Both times I've used this I still had to restart a few minutes later. One time Firefox just fully hung, another time the delay reappeared.

Edit3: It doesn't seem the issue is caused by any of the plugins, as it also appeared with the other half of my plugins deactivated.

Firefox still has the tendency to occasionally freeze and require a restart, but I'm not sure that this is actually related, or made more likely, by the typing/input issue. So "fixing" the input lag by creating a new window does still seem to offer a functional work-around.

1
  • 1
    Thanks, this worked! One small change: I couldn't even open a new window, so I just created a new tab in the problematic window and dragged it into a new window. After a few (maybe 25---didn't count) my keyboard started working in the new window, and so I dragged the problematic tabs to this new window and the keyboard worked in them too. No idea why, but happy to not have to restart my Firefox every time this happens. Commented Jul 3 at 18:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.