[feat] make window.focus based on a pref