I found out that the problem described at pkg/48168 happens when running firefox under spectrwm, but does not happen when running it under twm. Under spectrwm, there is also a work-around: if I open a terminal, su to become another user (root or not), and execute firefox, then the problem strangely doesn't happen.