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

Integration with ff2mpv #1077

Closed
arthsmn opened this issue Jan 17, 2024 · 7 comments
Closed

Integration with ff2mpv #1077

arthsmn opened this issue Jan 17, 2024 · 7 comments

Comments

@arthsmn
Copy link

arthsmn commented Jan 17, 2024

What command or commands

Add a feature to LinkHints

How should a feature do

When a user has done such steps:

  1. Press a keybinding to show the hints on links
  2. Choose a hint

then Vimium C should do:

  1. Send the link to ff2mpv or maybe open the link, execute ff2mpv in the new tab and then close it

Browser and OS

  • Browser name: Firefox 121.0.1
  • OS name: Linux 6.7.0 #1-NixOS SMP PREEMPT_DYNAMIC Sun Jan 7 20:18:38 UTC 2024
@gdh1995
Copy link
Owner

gdh1995 commented Jan 20, 2024

Um sorry it's impossible up to now, because ff2mpv doesn't expose such an interface to allow other extensions to activate it.

@arthsmn
Copy link
Author

arthsmn commented Jan 28, 2024

@gdh1995 now that woodruffw/ff2mpv#113 is merged could this be done?

@gdh1995
Copy link
Owner

gdh1995 commented Feb 10, 2024

Great! Then you may:

  1. add these to Custom key mappings:
map vvv LinkHints.activateOpenUrl sed="_ff2mpv"
map <v-ff2mpv> sendToExtension \
  id="ephjcajbkgplkjmelpglennepbpmdpjg" raw
  1. add these to Auto substitution of various text:
_ff2mpv@^@@,encode
_ff2mpv@^.*@vimium://run1/<v-ff2mpv>#data={"type":"openVideo","url":"$0"}@

Then LinkHints.activateOpenUrl will call sendToExtension with given id and a data of selected url.

====

BTW, in Vimium C v2.x, a simpler mapping will be:

map vvv LinkHints.activateOpenUrl keyword="ff2mpv"
map <v-ff2mpv> sendToExtension id="ephjcajbkgplkjmelpglennepbpmdpjg" raw

and

ff2mpv: vimium://run1/ff2mpv#data={"type":"openVideo","url":"$s"}

@arthsmn
Copy link
Author

arthsmn commented Feb 10, 2024

Great! Then you may:

1. add these to `Custom key mappings`:
map vvv LinkHints.activateOpenUrl sed="_ff2mpv"
map <v-ff2mpv> sendToExtension \
  id="ephjcajbkgplkjmelpglennepbpmdpjg" raw
2. add these to `Auto substitution of various text`:
_ff2mpv@^@@,encode
_ff2mpv@^.*@vimium://run1/<v-ff2mpv>#data={"type":"openVideo","url":"$0"}@

Then LinkHints.activateOpenUrl will call sendToExtension with given id and a data of selected url.

====

BTW, in Vimium C v2.x, a simpler mapping will be:

map vvv LinkHints.activateOpenUrl keyword="ff2mpv"
map <v-ff2mpv> sendToExtension id="ephjcajbkgplkjmelpglennepbpmdpjg" raw

and

ff2mpv: vimium://run1/ff2mpv#data={"type":"openVideo","url":"$s"}

This didn't work, sadly. It's saying that it couldn't establish connection. Using Vimium C version 1.99.997 and ff2mpv version 5.1.0.

gdh1995 added a commit that referenced this issue Feb 12, 2024
@gdh1995
Copy link
Owner

gdh1995 commented Feb 12, 2024

Um, now that you're using Firefox, please replace the id="**********" with id="ff2mpv@yossarian.net"

@arthsmn
Copy link
Author

arthsmn commented Feb 12, 2024

Um, now that you're using Firefox, please replace the id="**********" with id="ff2mpv@yossarian.net"

It worked! Thanks for your help!

Can this be added to the Wiki? I think it'll make it easier to find.

@arthsmn arthsmn closed this as completed Feb 12, 2024
@gdh1995
Copy link
Owner

gdh1995 commented Feb 13, 2024

Added https://github.com/gdh1995/vimium-c/wiki/Send-dynamic-messages-to-other-extensions .

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

No branches or pull requests

2 participants