Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to support firefox mobile? #1590

Open
Freed-Wu opened this issue Feb 21, 2024 · 4 comments
Open

Is it possible to support firefox mobile? #1590

Freed-Wu opened this issue Feb 21, 2024 · 4 comments

Comments

@Freed-Wu
Copy link
Contributor

Freed-Wu commented Feb 21, 2024

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
Copy link
Owner

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
Copy link
Contributor

alerque commented Mar 6, 2024

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
Copy link
Contributor Author

Freed-Wu commented Mar 6, 2024

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?

@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Apr 22, 2024

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 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants