philc / vimium

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

Chrome with Vimium not compatible to MacOS using Magic Mouse. #4503

Open couragelfyang opened 1 week ago

couragelfyang commented 1 week ago

Describe the bug

I'm using Chrome with Vimium. Yesterday I've got a Magic Mouse. I've found these two are not completely compatible.

When the option for Magic Mouse Gesture "Swipe Left or Right with One Finger" is checked, it does not work with Vimium. For example, after pressing r, Vimium key-binding to reload the page, the one-finger swipe navigating forward and backward through browsing history is not working. The solution is to click the touchpad once more, then the Magic Mouse gesture recovers.

But Vimium works perfectly with the option "Swipe Left or Right with Two Fingers", I have no idea why. However, it is not comfortable to swipe left or right with two fingers on the Magic Mouse, at least that's what I think.

I'm wondering if any guy else has the same problem. Any suggestion to handle it?

To Reproduce

Steps to reproduce the behavior:

  1. Make sure having a Apple Magic Mouse.
  2. Check on "Swipe Left or Right with One Finger" on Apple mouse setting.
  3. Press 'r' to reload the page.
  4. Swipe left or right with one finger to jump forward and backward not working.

Browser and Vimium version

Chrome: Version 126.0.6478.115 (Official Build) (x86_64) Vimium: Vimium 2.1.2 MacOS: Sonoma 14.5

If you're using Chrome, include the Chrome and OS version found at chrome://version. Also include the Vimium version found at chrome://extensions.

UncleSnail commented 1 week ago

Unfortunately I don't have a Mac or a Magic Mouse so it would be very difficult for me to debug and fix this issue properly, but my gut feeling (especially since two-finger swiping is working) is that to get one finger swiping working, they are loading some custom functionality into the webpage that requires the webpage being focused (or something similar). Chrome has built-in support for two finger swipe forward and back on touchpads, so it sounds like the Magic Mouse might just be using their swipes like a touchpad and using Chrome's default functionality to handle those swipes, thus why they would always work. If one finger isn't working, it sounds like they are handling that differently. So I would think either:

  1. They are doing some translation in the mouse that takes a one-finger swipe and sends it to the computer as a two-finger swipe. This seems less likely, as I don't know why that would be breaking. So option 2:
  2. They are custom-handling their own 1 finger swipe to tell the browser to go back.

Since clicking fixes the problem, that makes it seem even more likely to me that it is somehow a focus issue. A few questions that might help you or someone else get to the bottom of this.

  1. Does clicking anywhere fix the issue, or only inside the webpage?
  2. If you click somewhere else in the browser, like in the navbar, does that also break swipe navigation?
  3. Does anything else in Vimium break the navigation, like pushing "f" to enter follow mode, or is it only reloading the page?
  4. Does reloading the page with ctrl+r cause the same problem?

I hope you get it figured out.

couragelfyang commented 2 days ago
  1. No, it does not fix the issue by clicking anywhere or inside the webpage.
  2. No.
  3. Not yet. So far I don't find any other vimium operation breaking it.
  4. It should me be command+r. I've tried several times and found it works fine with command+r.

Besides, this issue also exists on Arc with vimium.