Open xudyang1 opened 5 months ago
Hi, thanks for opening this issue. eval_js
only supporting VimScript callbacks is indeed quite unfortunate, this is not something I would implement today.
Unfortunately, eval_js
is likely to stop working altogether soon when Firenvim is migrated to Manifest V3 (the new WebExtension API Chrome is forcing every extension to migrate to). Because of this, I would recommend not relying on eval_js
. If there is still a way to make eval_js
work with Manifest V3, I'll rework it to make it support lua callbacks too.
Hi, thanks for opening this issue.
eval_js
only supporting VimScript callbacks is indeed quite unfortunate, this is not something I would implement today.Unfortunately,
eval_js
is likely to stop working altogether soon when Firenvim is migrated to Manifest V3 (the new WebExtension API Chrome is forcing every extension to migrate to). Because of this, I would recommend not relying oneval_js
. If there is still a way to makeeval_js
work with Manifest V3, I'll rework it to make it support lua callbacks too.
Thank you for the detailed explanation! Firenvim already does its awesome job as a text editor in webpages. If eval_js
supports lua script and vim.api
in the future, it will definitely help users in interacting with DOM apis!
What I tried to do
I was testing
firenvim#eval_js
on the browser to retrieve page informatino so that I can decide{extension}
in filename based on the result.Here is an example command when invoke in firenvim's homepage:
What happened
Neovim got nothing in
:message
, and the browser loggedIt looks like
eval_js
can only work with vimscript/functions/apis, and neovim's apis are not recognized. Support for neovim's apis/lua functions reduces the overhead of writing vimscript in lua config files. If this feature is not planned, maybe we can provide some examples for users who like to write some vimscript in lua config files?