ozntel / oz-image-in-editor-obsidian

This Obsidian plugin to view Images, Transclusions, iFrames and PDF Files within the Editor without a necessity to switch to Preview.
339 stars 13 forks source link

Make the plugin available for mobile #22

Closed HEmile closed 3 years ago

HEmile commented 3 years ago

The plugin cannot currently be installed on mobile because manifest.json has desktoponly set to true. I browsed through the code and couldn't quickly find a reason why it can't be available on mobile. Any chance you can change this?

ozntel commented 3 years ago

Unfortunately Obsidian uses CodeMirror 6 for the mobile while desktop uses CodeMirror 5. The methods like iterateCodeMirrors or registerCodeMirror don't work anymore in CM6. The API for CM6 is also not enough to manipulate the line widgets yet. Therefore, the mobile version won't work even if I change the manifest.json

ankushg commented 3 years ago

Thanks for all your work @ozntel -- Is there a CodeMirror 6 issue we can follow that will unblock this?

ozntel commented 3 years ago

Thanks for all your work @ozntel -- Is there a CodeMirror 6 issue we can follow that will unblock this?

You can check this message on Discord for details: https://discord.com/channels/686053708261228577/889616783458304001/891342327052923000

ankushg commented 2 years ago

Now that there's some CM6 support in here, is it possible to use in mobile?

ozntel commented 2 years ago

It is possible only if you are insider. Right now you need to manually change "only for desktop" flag to false in manifest.json of the plugin but it will work only if you have the insider version of Obsidian. Once the mobile version with the new API will be officially released for everyone, I will also open plugin for mobile usage