function globalInitialization() {
    // Close the overlay on escape.
    document.addEventListener('keydown', function () {
      // Escape
      let overlay = getTopOverlay();
      if (!overlay) return;

      cr.dispatchSimpleEvent(overlay, 'cancelOverlay');
    });

    window.addEventListener('resize', setMaxHeightAllPages);

    setMaxHeightAllPages();
  }
Makes initializations which must hook at the document level.