fanglingsu / vimb

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.
https://fanglingsu.github.io/vimb/
GNU General Public License v3.0
1.33k stars 99 forks source link

`G` navigates to top of vimb manual instead of bottom #723

Closed cmvanb closed 1 year ago

cmvanb commented 1 year ago

Not sure if you wish to receive issues on the HTML documentation... anyways this was very confusing for a new user.

Steps to reproduce

Install vimb. Run vimb. Navigate to vimb manual at https://fanglingsu.github.io/vimb/. Note that G scrolls to top of page, not bottom.

Expected behaviour

G should scroll to bottom of page.

Actual behaviour

G scrolls to top of page on the vimb manual page. This must be an interaction between the vimb manual HTML and vimb, it works fine on other websites.

vimb --bug-info
Version:         3.6.0
WebKit compile:  2.34.6
WebKit run:      2.38.0
GTK compile:     3.24.33
GTK run:         3.24.34
libsoup compile: 2.74.2
libsoup run:     2.74.2
Extension dir:   /usr/lib/vimb
uname -a
Linux workstation 5.19.13-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 04 Oct 2022 14:36:58 +0000 x86_64 GNU/Linux
fanglingsu commented 1 year ago

@cmvanb Thank you for reporting this issue. This seems to be related to the document.body.scrollHeight used to get the heiht of the whole page. On the vimb page this is 0. For this document.documentElement.scrollHeight would work but not for other sites like https://www.jetbrains.com/help/idea/shared-indexes.html

So I assume we should use morde js code to get the page height properly. I'll try to use following construction https://javascript.info/size-and-scroll-window#width-height-of-the-document

fanglingsu commented 1 year ago

@cmvanb I use the more sophisticated approach to get the document length now.