improve window activation and re-compile behavior on Chrome