message: Fix website and editor failing to load on iOS versions < 14
diff: @@ -78,7 +78,26 @@ class ScreenService {
  ? true
  : run(() => {
  const match = window.matchMedia('not screen and (pointer: coarse)');
  - match.addEventListener('change', e => (Screen.isPointerMouse = e.matches));
  + const onChange = (e: MediaQueryListEvent) => (Screen.isPointerMouse = e.matches);
  +
  + // https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility
  + //
  + // Mobile Safari prior to version 14 doesn't support "addEventListener".
  + // Do this or the site will break for old iOS.
  + for (const key in ['addEventListener', 'addListener']) {
  + if (!Object.prototype.hasOwnProperty.call(match, key)) {
  + continue;
  + }
  +
  + if (key === 'addEventListener') {
  + // Use the current standard first if available.
  + match['addEventListener']('change', onChange);
  + } else if (key === 'addListener') {
  + // Fallback to the deprecated method if available.
  + match['addListener'](onChange);
  + }
  + }
  +
  return match.matches;
  });
  }
  