No need for `window.`, just `navigator` is fine.