obsidian-imgur-plugin
obsidian-imgur-plugin copied to clipboard
Enable for mobile
Hey! This plugin is enabled for desktop only right now. Do you think it's possible to enable it for mobile app? :)
Hi @piranha. I tried it on mobile by manually uploading it to mobile vault and changing isDesktopOnly
in manifest, but it does not work "as-is".
This plugin uploads images on:
- "drag" (when you use drag-and-drop) and
- "paste" (when you paste from the clipboard buffer) events
On mobile you are also allowed to add images from the gallery to your note. But looks like none of those events are used. I posted a quick question on Discord about how it works, but the question left unanswered.
So, in short:
- you can attach images from the gallery on mobile
- so I think there must be a way to override the default behaviour and perform remote upload instead. But for now I do not know which event is involved into this process
When I developed for desktop, there was a Chrome console which helped me a lot. For mobile, I do not know yet how to easily debug. There was a message in the chat on how to connect to remote console, but I haven't tried that yet.
Do you know if copy-paste is available for images on mobile platforms? I have an Android phone. I have a "Copy" context menu option in Chrome browser. When I go to Obsidian, and try to "Paste", simply nothing happens. At the same time if I go to Telegram and Paste the image previously copied from Chrome, it works! I think Obsidian for Android does not handle paste event as we and the current implementation of imgur plugin expects. If you have an iOS device, please let me know if you can copy/paste images there (with other, more mature apps) and if Obsidian can handle it or not
Yeah, I have an iOS device and nothing happens. I also installed an iPad version on macOS and nothing happens on pasting an image there. So I guess mobile app has no support for pasting anything but text right now.
Tried with iPhone too -> same result. Nothing happens on "paste" context menu item.
I created the feature request on Obsidian forums to support "pasting" images on mobile.
I have no idea about the events involved when pasting on mobile platforms. But there is a plugin that enables a dev console on mobile (I’ve only tried it on iOS). I think it needs to be installed manually, but it worked fine for me. Debugging this way is still cumbersome, but at least it’s something 😌
"This plugin does not support your device"
My situation is the following : I can't even enable the plugin on ipadOS, because (as is often the case) I get this red notice : "This plugin does not support your device". I wonder if this is easily fixable. Would love to learn how to fix this kind of thing as it is a recurring pbm with obsidian plugins on mobile.
Anyway, I have a feeling that the conversation has gotten a bit old and I'm not quite sure we're refering to the same issue : it seems that people here are refering to pasting images from a clipboard, which has only been made possible very recently on obsidian mobile ( forum.obsidian ).
Hi @A000045
You can easily fix this error message by opening the vault which you had on PC and changing one line in manifest.json
.
- Create the vault on PC
- Install Imgur plugin
- Go to
your_vault/.obsidian/plugins/obsidian-imgur-plugin/manifest.json
and change the value forisDesktopOnly
tofalse
- Somehow copy your vault to your mobile device (as an Android user, I use OneSync to sync my knowledge base between PC and mobile device)
- Open the vault which you just copied using mobile app. The plugin should be able to be "Enabled", but as I know it does not work on mobile (still did not find a time to debug it on mobile devices).
Today I've spent my morning on understanding why it does not work on mobile. It turned out to be surprisingly easy to enable debugging on mobile:
- enable USB debugging on Android phone
- connect it with USB to laptop
- open
chrome://inspect
right in the browser and choose Obsidian mobile app
So, I opened the "Network" tab to understand what's wrong and first thing I saw was net::ERR_HTTP2_PROTOCOL_ERROR
on request itself and TypeError: Failed to fetch
exception.
After more attempts to upload an image the error turned into 429 with human-readable payload:
{
"data": {
"error": "Imgur is temporarily over capacity. Please try again later."
},
"success": false,
"status": 403
}
I compared requests from desktop and mobile Obsidian apps and one major difference is that the Origin
header from mobile app is http://localhost
, while it is app://obsidian.md
for Desktop app. Then the "try again later" message makes sense to me, there are always too many requests from http://localhost
from around the world or it's a kind of banned forever by target servers, even though it's not explicitly prohibited by CORS.
I've posted a question on Obsidian forums about the possibility to get non-localhost value for Origin
header in mobile app. Let's see. If that's not possible even for Obsidian developers to affect this header for mobile app, then this feature will never be implemented.
Finally available in v2.4.0 🎉 (just released)