Scrolling the WebKit2.Webkit window in GTK + 3

How to scroll widget webkit2gtk?

In webkitgtk(aka. webkit1) You end your WebViewin ScrolledWindow, so you can use its property vadjustment.

For wekit2gtkthis call, it WebViewsimply returns None, and I see no other method to call.

As an explanation, I want to add touch support to webkit2. I hacked my way into this by adding a transparent layer on top of the widgetWebView ¹, but now I find strokes that I can't seem to use.

¹ The release that came out today eliminated the need for a layer on top. However, I have touches, and I cannot do anything with them.

+4
source share
2 answers

Separating a process in WebKit2 has some advantages, but it also complicates many things. I believe that scrolling is one of these things: this happens in the web process, because now the scroll bars are handled by webkit and not the Gtk widget. The same should be considered when working with touch control: it is partially performed in the web process. Carlos Garcia Campos wrote a blog post about using WebKitWebExtension to help with this. Note that design has many implications for your code: part of the code will work in a completely different process.

, , :

, DOM API, DOMDOMWindow.scroll*. DOMDOMWindow. WebExtension, -, , WebPage. WebPage.get_dom_document() DOMDocument, DOMDocument.get_default_view() DOMDOMWindow, .

DOM API Mozilla, , , spartan WebKit-GTK-DOM.

, , # webkitgtk + IRC- Freenode, , , ...

+6

javascript . C API webkit_web_view_run_javascript(), javascript,

window.scrollTo(500,0);

.

+3

Source: https://habr.com/ru/post/1526958/


All Articles