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

Custom hint commands #654

Closed
Anon1234 opened this issue Dec 28, 2015 · 8 comments
Closed

Custom hint commands #654

Anon1234 opened this issue Dec 28, 2015 · 8 comments
Labels

Comments

@Anon1234
Copy link

I'd like to know how to make my extension to be compatible with VimFx.

@Anon1234
Copy link
Author

So what I want to do: there is a useful extension called mpv-youtube-dl-binding
, it adds a context menu command which allows to open any link with mpv media player (or any other one). I'm using it to watch videos/playlists with on Youtube with mpv.
I'd like to implement a custom command in VimFx, that allows to select a link (similar to focus/follow link) and pass it to a function in mpv-youtube-dl-binding extension.

@lydell
Copy link
Collaborator

lydell commented Dec 28, 2015

That's not possible, and I have no intention to support it. I suggest doing the following:

  1. Focus the link using zf.
  2. Press the menu key on your keyboard (which opens the context menu).
  3. Press the access key for the mpv media player menu item.

@lydell lydell closed this as completed Dec 28, 2015
@lydell lydell added the wontfix label Dec 28, 2015
@dcrystalj
Copy link

i love mpv-youtube, i would love to see this feature as well. pressing zf on youtube does nothing

@Anon1234
Copy link
Author

@dcrystalj, I did it writing custom command. It also has this feature integrated. Feel free to check it out 😃

@dcrystalj
Copy link

sir i set:

  • devtools.chrome.enabled to true,
  • downloaded config template and extract it to ~/.mozilla/extensions/VimFx-config@vimgx.org
  • changed the config.js and frame.js
  • restarted browser
  • open youtube and press zf, selected link and press M

it does nothing.

@Anon1234
Copy link
Author

Hmm... It might be an issue with a new extensions signing thing:

Will there be a setting or other overrides to disable signature checks?

  • Firefox Release and Beta versions will not have any way to disable signature checks. Signature checks can be disabled in other versions, as described in detail

What are my options if I want to install unsigned extensions in Firefox?

  • The Developer Edition and Nightly versions of Firefox will have a setting to disable signature enforcement. There will also be special unbranded versions of Release and Beta that will have this setting, so that add-on developers can work on their add-ons without having to sign every build. To disable signature checks, > you will need to set the xpinstall.signatures.required preference to "false".
  • type about:config into the URL bar in Firefox
  • in the Search box type xpinstall.signatures.required
  • double-click the preference, or right-click and selected "Toggle", to set it to false.

So, if switching off the xpinstall.signatures.required isn't helping you, you need to move to Dev or Nightly, unfortunately.
Maybe @lydell knows a better way to make it work?

@lydell
Copy link
Collaborator

lydell commented Jan 14, 2016

@dcrystalj

devtools.chrome.enabled to true,

That has nothing to do with this.

downloaded config template and extract it to ~/.mozilla/extensions/VimFx-config@vimgx.org

That’s the wrong location. You probably meant something like ~/.mozilla/firefox/dz9zivt4.default/extensions/VimFx-config@vimfx.org.

selected link and press M

You have to set M as a shortcut for your new command first.


It sounds like you have one or more of the following problems:

  • You put the files in the wrong location.
  • You forgot to set M as a shortcut for your new command.
  • Mozillas choice to require extensions to be “signed” to be able to install them might get in your way. If you’re running Firefox < 43 you should be fine. If you run Firefox 43 you can set xpinstall.signatures.required to false. If you run Firefox > 43, you should consider yourself a developer and install Firefox Developer Edition. Unfortunately there is no better way currently.

I’d recommend that you start with following the setup instructions a bit more closely and just try to get your config add-on installed and running. Check the Add-ons Manager and the browser console!

Then try to add @Anon1234’s custom command.

@lydell lydell changed the title [question] How to make my extension compatible with VimFx Custom hint commands Jul 21, 2016
lydell added a commit that referenced this issue Aug 10, 2016
My first idea was to use `vim.enterMode('hints', ...)`. However, that's
too complicated to be useful for any user.

Actually, I found that `vim.enterMode(...)` is too complicated for most
(all?) modes, so I decided to make it private (removing it from the
public API) while at it. (I also made the arguments of
`vim.enterMode`/`mode.onEnter` more consistent with each other.)

I also considered exposing the entire "API" that the `f` commands use
internally. However, that's more complicated than the average user
needs, and would increase the API surface _a lot._

Instead, the `f` commands now take a `callbackOverride` argument. This
lets you choose the `f` command that matches the elements you're looking
for and the override what happens when a hint marker is matched.

Fixes #785. Fixes #654.
@lydell
Copy link
Collaborator

lydell commented Aug 10, 2016

FYI, I just added support for custom hints commands.

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

No branches or pull requests

3 participants