Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix: fall through to navigator.platform when userAgentData.platform is empty
In embedded browsers, userAgentData exists but platform can be undefined, causing early return of false instead of reaching the navigator.platform fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmitha Mallesh committed
Feb 22, 2026 at 20:22 UTC
b8e189c807d20a85fa294849b3222d64dfccc7ca
1 file changed
+4
-1
docs/components/ask-ai-button.tsx
+4
-1
@@ -29,7 +29,10 @@ export function toggleDecimalWidget() {
29
export function detectMac(): boolean {
30
try {
31
if ('userAgentData' in navigator) {
32
- return (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData?.platform === 'macOS';
32
+ const platform = (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData?.platform;
33
+ if (platform) {
34
+ return platform === 'macOS';
35
+ }
36
}
37
return /mac/i.test(navigator.platform);
38
} catch {