glacambre / firenvim

Embed Neovim in Chrome, Firefox & others.
GNU General Public License v3.0
4.71k stars 146 forks source link

Is it possible to support firefox mobile? #1590

Open Freed-Wu opened 7 months ago

Freed-Wu commented 7 months ago

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

glacambre commented 7 months ago

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).

alerque commented 7 months ago

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.

Freed-Wu commented 7 months ago

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 :smile:

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?

Freed-Wu commented 5 months ago

I take a look at this browser extension.

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

will generate

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 :cry: