Plugin platform awareness?

Just out of curiosity, is there currently any way for a plugin to be aware of whether it's running on mobile vs desktop?

I've been really enjoying the ability to use plugins (being able to quickly make links has made bullet journalling so much easier!) but I'm running into a few struggles where plugins are missing features that aren't needed on desktop but become required on mobile (eg due to the lack of keyboard shortcuts/mouse right clicking/etc)

While I'm not a plugin dev I thought it might be useful for plugins to know what platforms they're on in case they need to do things like create buttons for certain actions etc

Alternatively I can see an argument for not having different behaviour depending on the platform

Wondered what everyone's thoughts on this is?

Cheers

This is how the RevealJS Slides plugin does it:

Notes:

  • If the plugin targets only recent versions of Joplin, the try { ... } catch(error) { is unnecessary.
  • The as any cast is present because the updated .versionInfo return type hasn't been generated/published to NPM.
4 Likes

Darn it, classic case of not quite reading the API docs closely enough!

Thanks for the answer