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

How can website detect if vimium-c is running? #130

Closed
gqqnbig opened this issue Feb 19, 2020 · 1 comment
Closed

How can website detect if vimium-c is running? #130

gqqnbig opened this issue Feb 19, 2020 · 1 comment
Labels

Comments

@gqqnbig
Copy link

gqqnbig commented Feb 19, 2020

Some vimium-c keybindings conflicts when the shortcuts on my website.

I would like my website to detect if users are using vimium-c and give a message.

How can website detect if vimium-c is running?

@gdh1995
Copy link
Owner

gdh1995 commented Feb 24, 2020

Um, currently no a unified method to do this, because Vimium and Vimium C are trying to avoid "influence" normal web pages (there've been some discussions in Vimium's Issues panel).

Anyway, there indeed exist some methods to detect it. For example:

  • on Firefox, check window.__VimiumC_priv__ != null
  • on Chrome, use a XHR to request chrome-extension://hfjbmagddngcpeloejdejnfgbamkjaeg/lib/injector.js
  • on Chrome and before Vimium C v1.81 (not released yet), you can:
    • check ["()=>1", "() => 1"].includes("" + ((__VimiumC_)=>1))
    • the reason is Vimium C replaces all function body whose .indexOf('__VimiumC_') > 0 with "" + (() => 1), so you can do such a test
    • but this strange logic is just a typo and will be removed in Vimium C v1.81, in up to a month.

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

2 participants