Improve window handling in case of firefox crashes