philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.16k stars 2.48k forks source link

Make vimium work in Chrome WebStore and PDF viewer #3340

Open jefferyyuan opened 5 years ago

jefferyyuan commented 5 years ago
gdh1995 commented 5 years ago

Currently there's no API from Chrome to allow this.

The reason that "The Great Suspender" works is that it does not execute operations on the PDF "content", while Vimium needs. On a timer gets triggered, the suspender replaces the PDF (or Web Store) tab with one of its inner page, and then replace back when you click the page.

As for the "Vimium C", it's one of my personal extensions which is a customized version of Vimium, and the "PDF Viewer for Vimium C" is a special PDF viewer extension, which is NOT OFFICIAL, compiled from https://github.com/mozilla/pdf.js and with some modification. So, it's still not the case that an extension runs on Chrome's inner PDF viewer.

BTW, on Chrome, its default PDF viewer, chrome://* pages and the Chrome Web Store are privileged and no 3rd-party extensions can run on them. On Firefox, there's an extra limit that webextensions can't create a tab of about:* (except about:blank) or file:///*.

mrjared16 commented 5 years ago

Currently there's no API from Chrome to allow this.

The reason that "The Great Suspender" works is that it does not execute operations on the PDF "content", while Vimium needs. On a timer gets triggered, the suspender replaces the PDF (or Web Store) tab with one of its inner page, and then replace back when you click the page.

As for the "Vimium C", it's one of my personal extensions which is a customized version of Vimium, and the "PDF Viewer for Vimium C" is a special PDF viewer extension, which is NOT OFFICIAL, compiled from https://github.com/mozilla/pdf.js and with some modification. So, it's still not the case that an extension runs on Chrome's inner PDF viewer.

BTW, on Chrome, its default PDF viewer, chrome://* pages and the Chrome Web Store are privileged and no 3rd-party extensions can run on them. On Firefox, there's an extra limit that webextensions can't create a tab of about:* (except about:blank) or file:///*.

What is the difference between your Extension to Vimium? I install both on Opera and the extension doesn't work on Google.com, which is a huge inconvenience for me. Other extensions cannot work too. Does it cause by Opera or the Chromium API reason? Can I personally modify the source to make it work just for me?

gdh1995 commented 5 years ago

This Vimium is a stable browser extension, while my Vimium C is modified from Vimium, with more commands and features (also more bugs). I've tested it on Opera, so I'll have a test in recent days.

gdh1995 commented 5 years ago

@mrjared16 the probem that many extension can not run on google.com on Opera is beacuse:

mrjared16 commented 5 years ago

@mrjared16 the probem that many extension can not run on google.com on Opera is beacuse:

  • Opera has a particular option "Allow access to search page results" to control whether an extension can run on google.com
  • and this option is turned off by default, you have to turn on it for every extension you want
  • although its name has "aceess to search page results", in fact Opera only applies such a limit on google search result pages.
  • Even when your default search engine is not Google, the limit still exists and only exists on google.com.

You are my hero. Thank you!

nusssreiner commented 3 years ago

Maybe there is a way to just redirect keys while in the pdf viewer? I don't know how scrolling is embedded, but maybe it is possible to just implement that pressing j or k in the PDF viewer corresponds to pressing arrow keys? And that HJKL corresponds to pressing Alt+tab, Ctrl+tab, Ctrl+shift+tab, Alt+shift+tab. That way only these few commands would work but that would be fine for many users, since getting away from pdf tabs and scrolling through pdfs are the most needed features in this situation