Hacking Obsidian: Making a Desktop-only Plugin Work on your Phone or Tablet
Some Obsidian plugins are designed by their developers to only work on a desktop computer. However, this doesn’t mean they won’t work on mobile devices. In this article, I will discuss how to “hack” desktop-only plugins to work on mobile devices.
Obsidian and Mobile Devices
First a little background. The developers of Obsidian did an amazing job making Obsidian work well and consistently across multiple platforms: Mac, Windows, and Linux, and also mobile platforms: iOS and Android, both on phones and tablets.
As a software developer, I have published several plugins for Obsidian, and they all work on all platforms and all devices. It's rather amazing it all works and works so well.
However, for developers, while it isn’t hard to mobile enable plugins, it is extra work. For example, screen sizes can be much smaller or oddly shaped as compared to large desktop monitors. Additionally, some mobile devices lack the capabilities of a desktop computer, so some plugin functionality might have to be disabled on mobile devices.
Even so, most things work across all platforms and just require extra time for development and testing. This is a challenge for some developers, they don’t have the extra time or they are not interested in working on their mobile devices and are not willing to invest the extra effort.
Now having said all that, I have found that many plugins that are designed as “desktop-only” do work on mobile devices, just not perfectly.
Enabling a desktop-only plugin to work on mobile is easy. Let me outline the steps here on how to do it and also provide you with some precautions.
For the purpose of demonstration, let us use the popular Smart Connections Plugin which is a desktop-only plugin, but I have been using it on mobile.
Steps to Hack the Plugin to Work on the Phone and Tablet
First, find the plugin in your vault. Here is how to do that:
- Find the plugins folder for your Obsidian vault. Usually, it is in a hidden folder called .obsidian. My vault is named “MyNotes”. This means all my plugins are in the following sub-folder:
MyNotes/.obsidian/plugins/
- Now find the folder that contains the plugin you want to enable for use on mobile. For our example, it is the Smart Connections plugin:
MyNotes/.obsidian/plugins/smart-connections
This folder can contain many files, but there are three required files for a plugin to function:
- main.js — this is the code for the plugin. Do not edit this file.
- style.css — this is the CSS for the plugin. Do not edit this file. Though you can look at its contents to see how appearance formatting is handled in the plugin.
- manifest.json — This is the file that interests us! This is a simple file that contains the meta information about the plugin, such as the name of the plugin, the author’s name, the version number of the plugin, and so on.
As mentioned we are using the Smart Connections plugin for this demonstration. Here is the manifest.json file for this plugin:
{
"id": "smart-connections",
"name": "Smart Connections",
"author": "Brian Petro",
"description": "Find links to similar notes using artificial intelligence from OpenAI.",
"version": "1.6.8",
"minAppVersion": "1.1.0",
"authorUrl": "https://wfhbrian.com",
"isDesktopOnly": true
}
Don’t let all the crazy characters and oddities of this file scare you away. But please take a minute to look at it closely.
As you look at the contents of manifest.json, do you perhaps see what we need to change? I am guessing you found the line that says “isDesktopOnly”: true.
This is the line that needs to be modified to be false. So change the file to look like this:
{
"id": "smart-connections",
"name": "Smart Connections",
"author": "Brian Petro",
"description": "Find links to similar notes using artificial intelligence from OpenAI.",
"version": "1.6.8",
"minAppVersion": "1.1.0",
"authorUrl": "https://wfhbrian.com",
"isDesktopOnly": false
}
Once you have changed and saved the file, restart Obsidian.
I personally make these changes on my desktop, and then wait for those changes to be synced to my mobile devices.
After they are synced to the mobile device, you need to restart Obsidian on the mobile device. In some cases, you may also need to go into Settings > Community Plugins and toggle the plugin on.
In most cases, this desktop-only plugin will now be enabled on the mobile device.
Test, Test, Test!
Now that the plugin is enabled on your mobile device, do some testing to see if it works. While most features often work, there will be times when the plugin doesn’t behave normally. This is to be expected since the developer did not intend for the plugin to be used on mobile.
In other words, we are using the plugin at our own risk. But in some cases, as with the Smart Connections plugin, it is worth it!
Do some testing to understand what works and what doesn't work.
One common problem with plugins not designed for mobile is that the UI elements, such as the side panes don’t look right. The following picture shows how crammed the Smart Connections Plugin looks on my iPhone 13 mini, it's almost unusable since you cannot see the contents very well.
So what can you do in such scenarios? Three things:
- Don’t complain to the developer. You are doing something that is not intended with the plugin. However, you can nicely request a mobile version of the plugin. Kindness goes a long way.
- Use CSS to modify the layout of the plugin to fit your device better. It will be some work but might be well worth it.
- Don’t use the plugin. In some cases trying to force it to work on mobile just won’t work. So be realistic that some plugins are a no-go.
Updates to plugins
Keep the following in mind: when a plugin is updated, the manifest.json file is overwritten with the newest version of the update.
Therefore you will need to go back to the manifest.json file later to make the same change as we did before to the isDesktopOnly parameter. It is a bit of a pain, but not hard to do.
Remember, you are hacking Obsidian 🤓, so test and don’t be shocked when some things don’t work or don’t work they way you think.
But also don’t be shocked if they do work, and you just opened up no possibilities on your mobile device by enabling these so-called “Desktop-only” plugins.
Thank you for reading this article. Please check out more of my work at https://tfthacker.com