This is absolutely needed to fix a really nasty off screen focus to on screen focus bug with FF in which you can no longer enter edit mode using the mouse AND the cursor is rendered in the editor even though the notebook and cell appear to be in command mode. yikes!  I did, just to be sure, double check that removing this code does re-introduce the bug.