Can't be done. The system can always steal the focus at any time it wants to. (You really need that so that serious error messages can be displayed.) The extreme case is when you blue-screen.
If it's other applications or the web browser that steals the focus the answer is trivial. (Close the offending application.)