Skip to content

PlatformEx

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:15

Due to limitations of TypeScript, we cannot extend the Platform constant directly.

Example

import { Platform } from 'obsidian';
import type { PlatformEx } from 'obsidian-typings';
const platformEx = Platform as PlatformEx;
console.log(platformEx.canDisplayRibbon);

Extends

Properties

canDisplayRibbon

canDisplayRibbon: boolean

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:16


canExportPdf

canExportPdf: boolean

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:17


canPopoutWindow

canPopoutWindow: boolean

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:18


canSplit

canSplit: boolean

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:19


canStackTabs

canStackTabs: boolean

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:20


isAndroidApp

isAndroidApp: boolean

Defined in: obsidian.d.ts:3052

We’re running the Android app.

Inherited from

PlatformType.isAndroidApp


isDesktop

isDesktop: boolean

Defined in: obsidian.d.ts:3027

The UI is in desktop mode.

Inherited from

PlatformType.isDesktop


isDesktopApp

isDesktopApp: boolean

Defined in: obsidian.d.ts:3037

We’re running the electron-based desktop app.

Inherited from

PlatformType.isDesktopApp


isIosApp

isIosApp: boolean

Defined in: obsidian.d.ts:3047

We’re running the iOS app.

Inherited from

PlatformType.isIosApp


isLinux

isLinux: boolean

Defined in: obsidian.d.ts:3078

We’re on a Linux device.

Inherited from

PlatformType.isLinux


isMacOS

isMacOS: boolean

Defined in: obsidian.d.ts:3068

We’re on a macOS device, or a device that pretends to be one (like iPhones and iPads). Typically used to detect whether to use command-based hotkeys vs ctrl-based hotkeys.

Inherited from

PlatformType.isMacOS


isMobile

isMobile: boolean

Defined in: obsidian.d.ts:3032

The UI is in mobile mode.

Inherited from

PlatformType.isMobile


isMobileApp

isMobileApp: boolean

Defined in: obsidian.d.ts:3042

We’re running the capacitor-js mobile app.

Inherited from

PlatformType.isMobileApp


isPhone

isPhone: boolean

Defined in: obsidian.d.ts:3057

We’re in a mobile app that has very limited screen space.

Inherited from

PlatformType.isPhone


isSafari

isSafari: boolean

Defined in: obsidian.d.ts:3084

We’re running in Safari. Typically used to provide workarounds for Safari bugs.

Inherited from

PlatformType.isSafari


isTablet

isTablet: boolean

Defined in: obsidian.d.ts:3062

We’re in a mobile app that has sufficiently large screen space.

Inherited from

PlatformType.isTablet


isWin

isWin: boolean

Defined in: obsidian.d.ts:3073

We’re on a Windows device.

Inherited from

PlatformType.isWin


mobileDeviceHeight

mobileDeviceHeight: number

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:21


mobileKeyboardHeight

mobileKeyboardHeight: number

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:22


mobileSoftKeyboardVisible

mobileSoftKeyboardVisible: boolean

Defined in: src/obsidian/internals/Platform/PlatformEx.d.ts:23


resourcePathPrefix

resourcePathPrefix: string

Defined in: obsidian.d.ts:3092

The path prefix for resolving local files on this platform. This returns:

  • file:/// on mobile
  • app://random-id/ on desktop (Replaces the old format of app://local/)

Inherited from

PlatformType.resourcePathPrefix