gdh1995 / vimium-c

A keyboard shortcut browser extension for keyboard-based navigation and tab operations with an advanced omnibar
https://chrome.google.com/webstore/detail/vimium-c/hfjbmagddngcpeloejdejnfgbamkjaeg
Other
3.17k stars 253 forks source link

Copying Vimium-c files into another extension of MV3? #1111

Open jaywonchung opened 3 months ago

jaywonchung commented 3 months ago

Hi,

Recently Google Scholar released the Google Scholar PDF viewer extension, which is really nice, except that I can't scroll with my usual Vimium keybindings. It also uses the V3 manifest, which does not allow sourcing scripts from another extension.

So I thought it would be possible to directly copy over files from vimium-c into a locally forked version of the Google Scholar PDF viewer extension. So I copied over the entire lib directory and added <script src="/lib/injector.js"></script> in all HTML files., but unfortunately keybindings still do not work. Do you think copying files could potentially work? If so, which files should be copied?

Thanks a lot.

gdh1995 commented 1 month ago

Hello thanks for your recognition first!

The lib folder is not necessary; lib/injector.js is only designed to work in a MV2 target. So up to now there's no verified way to make Vimium C content scripts work on another MV3 extension.

You may try add lib/injector.js, content/vimium-c.js and content/injected_end.js manually, although there may be quite a few errors to fix...