minbrowser / min

A fast, minimal browser that protects your privacy
https://minbrowser.org/
Apache License 2.0
7.72k stars 684 forks source link

Indicator showing when page is about to go to previous page #2241

Open devgocri opened 1 year ago

devgocri commented 1 year ago

Sorry, but I didn't really know how to word the title.

Basically, when I zoom in through the trackpad in certain sites, and then attempt to move backwards in the website itself, I randomly end up in the previous webpage that I was visiting. I had no way of knowing whether I was triggering this, so an indicator similar to Chrome (see below) would be useful, both for moving backwards and forwards through your previous sites.

image

devgocri commented 1 year ago

It also happens when I scroll across a website when there is a visible horizontal scrollbar. I end up having to scroll through the website horizontally at 1 micrometer a second or get frustrated and open it in a new browser.

PalmerAL commented 11 months ago

@devgocri Can you send me a link to a page where this is happening? I think I've had this happen to me before as well, but it's not happening for me at the moment. (In theory, we should be detecting horizontal-scrolling containers and not triggering the go-back gesture on them).

How far zoomed in is the page? It looks like our measurements of how far you've swiped get scaled up as you zoom, so that could be contributing to the problem.

devgocri commented 11 months ago

It occurs on every website when zooming in and then trying to move across the page (I tried it on this page and it worked).

In terms of sites that have horizontally scrolling containers by default, the main one I have visited mostly is Microsoft OneNote, where moving across the page horizontally when the page isn't zoomed in still causes the page to go backward.

devgocri commented 11 months ago

Although this sort of seems inconsistent - I went on Google Sheets and moved across the document yet the go-back gesture didn't trigger.

PalmerAL commented 11 months ago

I think I've fixed both issues here: https://github.com/minbrowser/min/tree/disable-gestures-in-iframe. Could you test it and let me know?

On onenote, the entire page is an iframe, which makes the script we inject to determine the scroll position at the start of the gesture not work. I've changed this so we disable gestures when the mouse is over an iframe, but swipe gestures won't work at all one onenote as a result. I think this is still better than the current behavior.

devgocri commented 11 months ago

Hey @PalmerAL, the change on OneNote seems to have worked, it doesn't go to the previous webpage anymore when I'm moving across a page.

I also tested by zooming in on Google, but the webpage does go to the previous site when I try to move horizontally across the page... it still goes backwards into my previous sites unless I move super slowly.

Maybe it just shouldn't allow you to trigger the go-back gesture unless you reach either the left or right side of the page and there's nothing more to scroll?

PalmerAL commented 11 months ago

Maybe it just shouldn't allow you to trigger the go-back gesture unless you reach either the left or right side of the page and there's nothing more to scroll?

It's supposed to be doing that already, but it's clearly not working. I think the issue may be that we're clearing the stored scroll position too early, before you've actually finished scrolling. I've pushed another commit to the branch; can you try it out?

devgocri commented 11 months ago

@PalmerAL It seems to be fixed now! (sorry for the slow reply)

PalmerAL commented 11 months ago

Great!

devgocri commented 9 months ago

@PalmerAL In version 1.29.0, the detection is still way too sensitive when zooming in, as if it wasn't fixed/is more sensitive now. The iframe fix seemed to have worked though, tested on OneNote.

strindhaug commented 1 month ago

Still ridiculously sensitive on Mac touchpad. It doesn't matter if there is horizontal scrolling left or not… Besides, it should probably not activate at all or require significant overscroll when there is horizontal scrolling. How should the user know that theres only 20 px left to scroll and once they scroll 21px further a back or forward event will be triggered. At least require you to scroll more than a few millimeters/pixels before triggering!

On Chome it seems to require at least 1 cm movement before triggering the indicator; and you can still avoid triggering it by swiping back once the indicator appears. Chrome is still too sensitive for my fine motor skills, but slightly less unusable because of the slightly higher tolerance and indicator at least giving me a hint of what happened.

For accessibility reasons this swipe for navigation feature should be possible to disable without requiring a rebuild, since not everyone is able to control their fingers super accurately.