CIA Compliance Manager — API Documentation - v1.1.80
    Preparing search index...

    Function detectPlatform

    • Detect the current platform

      Uses modern navigator.userAgentData when available, with fallback to the older navigator.platform property for browsers that don't support it. Result is cached for performance.

      Returns Platform

      The detected platform

      // Simple platform detection
      const platform = detectPlatform();

      if (platform === 'mac') {
      console.log('User is on macOS - show Cmd shortcuts');
      } else if (platform === 'windows') {
      console.log('User is on Windows - show Ctrl shortcuts');
      }

      // Use in keyboard shortcut display
      const modifier = platform === 'mac' ? '⌘' : 'Ctrl';
      const shortcutText = `${modifier}+K to search`;