Enhanced permission check with better debugging:
Error Handling Improvements:
- Added 10-second timeout to detect if promise never resolves
- Added method existence check before calling
- Added promise validation (checks if result is actually a promise)
- Added detailed console logging at each step
- Added result validation (checks if result is null/undefined)
Debugging Features:
- Logs plugin availability and method types
- Logs promise type and result structure
- Logs all error details (message, type, stack)
- Shows available methods if checkPermissionStatus is missing
Fixes:
- Status stuck on 'Checking permissions...'
- Better error messages to diagnose issues
- Timeout prevents infinite waiting
Result: Should now show either permission status or clear error message