WebKit is a html rendering engine developed by Apple and primarily used in its Safari web browser, as well as all iOS web browsers. WebKitGtk is a GTK toolkit that can call WebKit under Linux GTK platform. This app shows how to create a very simple web browser using WebKit running on a GTK+3 Linux platform.
- Define an entry for entering URI.
- Define buttons: Go, Zoom In and Zoom Out for controlling the browser.
- Include component WebKit2Gtk by
from gi.repository import WebKit2
andWebKit2.WebView()
. - Use the command
webview.load_uri()
to load a web page. - Use the command
webview.set_zoom_level(zoom_size)
to zoom the web page, wherezoom_size
= 1.0 means 100%.
Reference
https://webkitgtk.org/reference/webkit2gtk/2.5.1/WebKitWebView.html
To install the component WebKit2Gtk under Debian Linux:# apt-get install gir1.2-webkit2-4.0
No comments:
Post a Comment