emacs-eaf / eaf-browser

A modern, customizable and extensible browser in Emacs
GNU General Public License v3.0
129 stars 26 forks source link

Cannot use `C-n`, `C-p`, `prior`, `next` to scroll some websites #25

Closed taquangtrung closed 2 years ago

taquangtrung commented 2 years ago

Hi,

Describe the bug

EAF-browser can not scroll some websites by pressing the C-n, C-p, prior, next keys.

To Reproduce

Expected behavior

The website should be scrolled accordingly.

Versions (please complete the following info):

MatthewZMD commented 2 years ago

The problem has to do with JS functions like document.scrollingElement.scrollBy(0, 50) not working in this webpage, it is not a problem on EAF, you can try in devtools yourself and compare the results in this site and other sites.

However, if you have time, you could try to investigate a better command to control website movements, maybe investigate how vimium handles it.

taquangtrung commented 2 years ago

@MatthewZMD: thanks for the suggestions on vimium!

I also did a quick investigation previously, but still don't know why those Javascript scrolling functions don't work with that website.

MatthewZMD commented 2 years ago

@MatthewZMD: thanks for the suggestions on vimium!

I also did a quick investigation previously, but still don't know why those Javascript scrolling functions don't work with that website.

Yeah, it probably has to do with how the site was written.

manateelazycat commented 2 years ago

Because current use JS scroll page, it will failed on some website, we should send wheel_scroll Qt event to EAF widget, then this issue will fixed.

manateelazycat commented 2 years ago

Fixed by patch https://github.com/emacs-eaf/emacs-application-framework/commit/88a3bef4c1204d5efc04709f37857d7ac5582364

Thanks for report

taquangtrung commented 2 years ago

@manateelazycat: awesome! Thanks a lot for the update.

Now I can scroll the website https://stevedonovan.github.io/rust-gentle-intro/ by C-n, C-p effortlessly!