two-finger-history-jump icon indicating copy to clipboard operation
two-finger-history-jump copied to clipboard

Multiple pages jumps

Open leonixyz opened this issue 4 years ago • 2 comments

user reported:

for the most part the plugin works well except it seems extremely sensitive. I often find that it will jump 2 - 3 pages back with one tiny swipe.

I have turned the sensitivity and responsiveness all the way down and tried to configure it multiple ways and never can get it to stop jumping back so far. Not too sure what could cause this.

leonixyz avatar Dec 03 '20 08:12 leonixyz

I can confirm this. How about just setting 1 swipe = 1 page back instead of depending on how long the swipe is?

imjuzcy avatar Jul 03 '21 08:07 imjuzcy

@ImjuzCY thanks for reporting.

The problem is that the swipe event measures a really tiny movement. For example, suppose you were able to swipe just a single pixel to the left, that is going to be sufficient to trigger the event handler.

Therefore we have to "accumulate" the number of pixels you have swiped to any direction, and then trigger the page load only if they exceed a given threshold.

I suppose, however, that this bug has something to do with the way the browser internally handles the extension's code/data. It seems to me that, when you go back in history, the javascript thread does not get restarted and some values are preserved. This causes the extension to jump multiple pages at once.

I remember I did some tests by setting a timeout for the extension to start subscribing a handler to the swipe event, but I wasn't satisfied by the result and did not commit the changes.

Hopefully I will find some time soon to get back to this problem

leonixyz avatar Jul 05 '21 08:07 leonixyz