glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to support firefox mobile?

Freed-Wu opened this issue · comments

commented

Firefox mobile support addons:

https://addons.mozilla.org/en-US/android/

Is it possible to support firefox mobile? the neovim can be installed by termux

Hi, sorry, I saw the notification for your issue and forgot to answer.

Unfortunately, Firenvim relies on the Native Messaging webextension API in order to connect to Neovim, and this API is not supported by Firefox for Android (and as far as I know, there are no plans to support it).

Even if Mozilla wanted to support this, I don't think the way sandboxing works on Android would allow it to be viable. You just don't get access to other apps or arbitrary system processes.

Perhaps an alternative would be getting NeoVIM compiled completely to WASM so it could be embedded in the extension itself. This might allow it to be used as an editor, but do note that it would be siloed from whatever other apps were on the system. I don't think it would get filesystem access to read RC files or anything since the parent app doesn't have those permissions. You would have to keep an RC setup in local storage. In the end this wouldn't be at all the same experience as using your fully configured desktop editor.

commented

You would have to keep an RC setup in local storage.

No serious, Even if it is a neovim only with default config, it will be enough powerful.

NeoVIM compiled completely to WASM

I heard vim.wasm. Does neovim also have wasm? Sounds amazing 😄

allow it to be viable

I know neovim is available in android by termux. let it visible for firefox mobile should be hard.

don't get access to other apps or arbitrary system processes

Do you mean this app need priviledge of root by magisk or shell by shizuku?

commented

I take a look at this browser extension.

vi --headless "+call firenvim#install(0) | q"

will generate

  • ~/.local/share/firenvim/firenvim, which is a wrapper shell script to exec nvim.
  • ~/.mozilla/native-messaging-hosts/firenvim.json, which will be called by browser.runtime.connectNative("firenvim") in firefox extension's background.js to let firefox communicate with neovim by stdio.

So, for Android termux's nvim, ~/.local/share/firenvim/firenvim cannot be called by other APK due to not enough permission to access /data/data/com.termux/files/home.
And android's firefox mobile also doesn't have ~/.mozilla/native-messaging-hosts of Native Messaging webextension API .

Sounds like wasm is only method 😢