Neutral globals
Things like navigator aren't specific to visual representation of a window.
Just omit window. and read it directly:
- navigator
- navigator.userAgent
- atob
- fetch
Window-specific globals
Things specific to user interaction or visual/aural representation like DOM or AudioContext, or those that may show a prompt for user permissions.
Not available in a worker.
Aliases for window
Use them instead of window for code clarity or if a local variable is named just as a global property.
- Built-in - globalThis(Chrome/ium 71+, FF 65+) and- self
 - These are worker-compatible aliases for the global scope. Note that a JS library you're loading may redefine them theoretically, but that'd be really weird and abnormal. 
- Self-made - global
 - The most reliable method, but you'll have to add - 'use strict'only inside an IIFE not globally.
 This is already offered by bundlers like webpack.
 Here's how you can replicate it yourself:
 - const global = (function(){
  if (!this) throw "Don't add 'use strict' globally, use it inside IIFE/functions";
  return this;
})();