Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Scroll page down

Post Reply
Maksym
Posts: 18
Joined: Wed Dec 20, 2023 11:13 am

Scroll page down

Post by Maksym »

What is the most reliable way to programmatically scroll the page down inside the browser? I know I can send the WM_KEYDOWN event and then the WM_KEYUP event with the code of the [End] button, and it works. But not when some input inside the page has the focus.

So, I need to make sure that when the page CAN be scrolled down (it has a vertical scrollbar, and that scrollbar is not at the bottom), it WILL be scrolled down without any interaction from the user. Is it possible? Maybe the WM_MOUSEWHEEL is reliable in this case? Will it work if the browser has no focus at all (it's invisible). Maybe I do not need to use any events, and there is some internal mechanism for that available in CEF?

Thank you in advance!
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Scroll page down

Post by salvadordf »

Hi,

Try executing this JS code:
https://stackoverflow.com/questions/11715646/scroll-automatically-to-the-bottom-of-the-page
Maksym
Posts: 18
Joined: Wed Dec 20, 2023 11:13 am

Re: Scroll page down

Post by Maksym »

Thank you Salvador! I'll try!
Post Reply