Bug 240232

Summary: [GTK] Add a way to set and get the scrollbar position in a WebView
Product: WebKit Reporter: Disable Graphics <mangacarrones>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Enhancement CC: bugs-noreply
Priority: P3 Keywords: Gtk
Version: Other   
Hardware: PC   
OS: Linux   

Description Disable Graphics 2022-05-09 06:32:56 PDT
Hobbyist developers like me don't have the time to read the JavaScriptCore API documentation and WebKitWebExtensions won't show the scrollbar position since they only execute when the page loads (Probably I'm missing something, if so, please correct me), so webkit_dom_dom_window_get_scroll_y() will always return 0 (And it's deprecated). Also, there's only one decent tutorial about WebKitWebExtensions (this one: https://blogs.igalia.com/carlosgc/2013/09/10/webkit2gtk-web-process-extensions/), and the other one is in the official WebKitGTK documentation. These two don't cover anything related to this issue.

Adding a way to get and set the scrollbar position would ease the task for many developers, hobbyist or not, as it would not require to write an extension (Requiring, in most cases, reading lots and lots of documentation, which can or cannot be understood)

The functions that I'm proposing would be:

    gdouble webkit_web_view_get_scroll_y(WebKitWebView * web_view)

    gdouble webkit_web_view_get_scroll_x(WebKitWebView * web_view)

    void webkit_web_view_set_scroll_y(WebKitWebView * web_view, gdouble y)

    void webkit_web_view_set_scroll_x(WebKitWebView * web_view, gdouble x)

The ranges would be between 0.0 and 1.0. The y's are for vertical scroll and the x's for horizontal.